1
0
Fork 0

Compare commits

..

2 commits

Author SHA1 Message Date
c6e976889f Deactivate one shot keys if already used in next keydown 2022-02-22 22:40:23 -03:00
e97eef5f86 Keymap: Add key to mute mic 2022-02-22 22:38:21 -03:00
3 changed files with 17 additions and 2 deletions

View file

@ -5,6 +5,8 @@
#define LA_SYM MO(SYM) #define LA_SYM MO(SYM)
#define LA_NAV MO(NAV) #define LA_NAV MO(NAV)
#define MUTE LGUI(KC_C)
enum layers { enum layers {
DEF, DEF,
SYM, SYM,
@ -37,7 +39,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
[NAV] = LAYOUT( [NAV] = LAYOUT(
KC_TAB, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, RESET, KC_CAPS,XXXXXXX,XXXXXXX,XXXXXXX, KC_TAB, XXXXXXX,XXXXXXX,XXXXXXX,MUTE, RESET, KC_CAPS,XXXXXXX,XXXXXXX,XXXXXXX,
OS_SHFT,OS_ALT, OS_CTRL,OS_CMD, XXXXXXX, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,KC_BSPC, OS_SHFT,OS_ALT, OS_CTRL,OS_CMD, XXXXXXX, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,KC_BSPC,
XXXXXXX,XXXXXXX,OS_RALT,XXXXXXX,KC_PSCR,XXXXXXX,XXXXXXX,XXXXXXX,KC_PGDN,KC_PGUP,XXXXXXX,KC_ENT, XXXXXXX,XXXXXXX,OS_RALT,XXXXXXX,KC_PSCR,XXXXXXX,XXXXXXX,XXXXXXX,KC_PGDN,KC_PGUP,XXXXXXX,KC_ENT,
XXXXXXX,XXXXXXX,XXXXXXX,_______,_______,XXXXXXX,XXXXXXX,_______,_______,XXXXXXX,XXXXXXX,XXXXXXX XXXXXXX,XXXXXXX,XXXXXXX,_______,_______,XXXXXXX,XXXXXXX,_______,_______,XXXXXXX,XXXXXXX,XXXXXXX

View file

@ -37,6 +37,18 @@ void update_oneshot(
*state = os_up_unqueued; *state = os_up_unqueued;
unregister_code(mod); unregister_code(mod);
} }
if (!is_oneshot_ignored_key(keycode)) {
switch (*state) {
case os_up_used:
unregister_code(mod);
break;
case os_up_queued:
*state = os_up_used;
break;
default:
break;
}
}
} else { } else {
if (!is_oneshot_ignored_key(keycode)) { if (!is_oneshot_ignored_key(keycode)) {
// On non-ignored keyup, consider the oneshot used. // On non-ignored keyup, consider the oneshot used.
@ -44,7 +56,7 @@ void update_oneshot(
case os_down_unused: case os_down_unused:
*state = os_down_used; *state = os_down_used;
break; break;
case os_up_queued: case os_up_used:
*state = os_up_unqueued; *state = os_up_unqueued;
unregister_code(mod); unregister_code(mod);
break; break;

View file

@ -6,6 +6,7 @@
typedef enum { typedef enum {
os_up_unqueued, os_up_unqueued,
os_up_queued, os_up_queued,
os_up_used,
os_down_unused, os_down_unused,
os_down_used, os_down_used,
} oneshot_state; } oneshot_state;