fix(automouse): prevent mouse keys to trigger auto mouse on other layers

This commit is contained in:
Florian Didron
2025-09-08 13:13:35 +07:00
parent c39a26ec9d
commit c9b57da40f

View File

@@ -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) {
// 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;
}