summaryrefslogtreecommitdiffstats
path: root/keyboards/clueboard/keymaps
diff options
context:
space:
mode:
authortengg <tengg@users.noreply.github.com>2017-05-18 03:20:01 +0200
committerskullydazed <skullydazed@users.noreply.github.com>2017-05-18 03:20:01 +0200
commitaaa01d0a4e633e26c58e5bc9c0bc557604088140 (patch)
treeb3b3e5c660a31d8facd4b28d7b226e2617a251f9 /keyboards/clueboard/keymaps
parent8da442f411a7fe0d9a5521ac6e95e20c7923caf1 (diff)
downloadqmk_firmware-aaa01d0a4e633e26c58e5bc9c0bc557604088140.tar.gz
qmk_firmware-aaa01d0a4e633e26c58e5bc9c0bc557604088140.tar.xz
ESC/GRAVE/TILDE better handling (#1307)
* revise HHKB bootloader_size to 4096 such that sw reset works * cleanup esr/grave/tilde handling function
Diffstat (limited to 'keyboards/clueboard/keymaps')
-rw-r--r--keyboards/clueboard/keymaps/mac_optimized/keymap.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/keyboards/clueboard/keymaps/mac_optimized/keymap.c b/keyboards/clueboard/keymaps/mac_optimized/keymap.c
index 7ea02d27e..e72733092 100644
--- a/keyboards/clueboard/keymaps/mac_optimized/keymap.c
+++ b/keyboards/clueboard/keymaps/mac_optimized/keymap.c
@@ -50,35 +50,28 @@ const uint16_t PROGMEM fn_actions[] = {
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t mods_pressed;
- static bool mod_flag;
switch (id) {
case 0:
/* Handle the combined Grave/Esc key
*/
- mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
-
if (record->event.pressed) {
/* The key is being pressed.
*/
+ mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
if (mods_pressed) {
- mod_flag = true;
- add_key(KC_GRV);
- send_keyboard_report();
+ register_code(KC_GRV);
} else {
- add_key(KC_ESC);
- send_keyboard_report();
+ register_code(KC_ESC);
}
} else {
/* The key is being released.
*/
- if (mod_flag) {
- mod_flag = false;
- del_key(KC_GRV);
- send_keyboard_report();
+ if (mods_pressed) {
+ mods_pressed = false;
+ unregister_code(KC_GRV);
} else {
- del_key(KC_ESC);
- send_keyboard_report();
+ unregister_code(KC_ESC);
}
}
break;