* revise HHKB bootloader_size to 4096 such that sw reset works
* cleanup esr/grave/tilde handling function
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t mods_pressed;
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t mods_pressed;
switch (id) {
case 0:
/* Handle the combined Grave/Esc key
*/
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.
*/
if (record->event.pressed) {
/* The key is being pressed.
*/
+ mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
- mod_flag = true;
- add_key(KC_GRV);
- send_keyboard_report();
- add_key(KC_ESC);
- send_keyboard_report();
}
} else {
/* The key is being released.
*/
}
} 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);
- del_key(KC_ESC);
- send_keyboard_report();
+ unregister_code(KC_ESC);