Merge pull request #1170 from tengg/master
fixed a bug related to mod + Grave with combined ESC/Grave key
This commit is contained in:
commit
dd967f2c05
@ -50,6 +50,7 @@ const uint16_t PROGMEM fn_actions[] = {
|
|||||||
|
|
||||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||||
static uint8_t mods_pressed;
|
static uint8_t mods_pressed;
|
||||||
|
static bool mod_flag;
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -62,6 +63,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
|||||||
*/
|
*/
|
||||||
if (mods_pressed) {
|
if (mods_pressed) {
|
||||||
add_key(KC_GRV);
|
add_key(KC_GRV);
|
||||||
|
mod_flag = true;
|
||||||
send_keyboard_report();
|
send_keyboard_report();
|
||||||
} else {
|
} else {
|
||||||
add_key(KC_ESC);
|
add_key(KC_ESC);
|
||||||
@ -70,8 +72,9 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
|||||||
} else {
|
} else {
|
||||||
/* The key is being released.
|
/* The key is being released.
|
||||||
*/
|
*/
|
||||||
if (mods_pressed) {
|
if (mod_flag) {
|
||||||
del_key(KC_GRV);
|
del_key(KC_GRV);
|
||||||
|
mod_flag = false;
|
||||||
send_keyboard_report();
|
send_keyboard_report();
|
||||||
} else {
|
} else {
|
||||||
del_key(KC_ESC);
|
del_key(KC_ESC);
|
||||||
|
Loading…
Reference in New Issue
Block a user