Merge pull request #123 from okke-formsma/bugfix-modtap

fix bug in modtap behavior which cleared the wrong keycode events
This commit is contained in:
Pete Johanson 2020-08-27 04:03:58 -04:00 committed by GitHub
commit 7d8c0411d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -193,8 +193,8 @@ static int on_keymap_binding_released(struct device *dev, u32_t position, u32_t
} }
struct keycode_state_changed *ev = data->captured_keycode_events[j].event; struct keycode_state_changed *ev = data->captured_keycode_events[j].event;
data->captured_keycode_events[i].event = NULL; data->captured_keycode_events[j].event = NULL;
data->captured_keycode_events[i].active_mods = 0; data->captured_keycode_events[j].active_mods = 0;
LOG_DBG("Re-sending latched key press for usage page 0x%02X keycode 0x%02X state %s", ev->usage_page, ev->keycode, (ev->state ? "pressed" : "released")); LOG_DBG("Re-sending latched key press for usage page 0x%02X keycode 0x%02X state %s", ev->usage_page, ev->keycode, (ev->state ? "pressed" : "released"));
ZMK_EVENT_RELEASE(ev); ZMK_EVENT_RELEASE(ev);
k_msleep(10); k_msleep(10);