summaryrefslogtreecommitdiff
path: root/keyboards/clueboard/keymaps/mac_optimized
diff options
context:
space:
mode:
authorStick <nstickney@gmail.com>2017-06-02 19:50:54 -0500
committerStick <nstickney@gmail.com>2017-06-02 19:50:54 -0500
commit4ba9917f829885b13ea1b3610a2f988e539c9e01 (patch)
tree612da1c6de929e6e0a5b0847d7b594cb3becdf27 /keyboards/clueboard/keymaps/mac_optimized
parent8665ed3efc62e649d0eac5b88761d7b3f8f30cd7 (diff)
parentaaa67f69305c5c78e15a1090ba7058adea59ff36 (diff)
downloadqmk_firmware-4ba9917f829885b13ea1b3610a2f988e539c9e01.tar.gz
qmk_firmware-4ba9917f829885b13ea1b3610a2f988e539c9e01.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'keyboards/clueboard/keymaps/mac_optimized')
-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 7ea02d27e8..e72733092f 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;