mirror of
https://github.com/zsa/qmk_firmware.git
synced 2026-05-07 11:59:00 +00:00
fix(automouse): prevent mouse keys to trigger auto mouse on other layers
This commit is contained in:
@@ -442,7 +442,14 @@ bool process_auto_mouse(uint16_t keycode, keyrecord_t* record) {
|
|||||||
*/
|
*/
|
||||||
static bool is_mouse_record(uint16_t keycode, keyrecord_t* record) {
|
static bool is_mouse_record(uint16_t keycode, keyrecord_t* record) {
|
||||||
// allow for keyboard to hook in and override if need be
|
// allow for keyboard to hook in and override if need be
|
||||||
if (is_mouse_record_kb(keycode, record) || IS_MOUSEKEY(keycode)) return true;
|
if (is_mouse_record_kb(keycode, record)) return true;
|
||||||
|
|
||||||
|
// if it's a mouse key, only treat it as a mouse record if we're currently on the auto mouse target layer
|
||||||
|
// this prevents mouse keys from activating the auto mouse layer when pressed on other layers
|
||||||
|
if (IS_MOUSEKEY(keycode)) {
|
||||||
|
return layer_state_is((AUTO_MOUSE_TARGET_LAYER));
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user