Closed tmk closed 1 year ago
These values(0xF0-F3) conflict with mousekey keycodes: KC_MS_UP
- KC_MS_RIGHT
.
Instead, 0xE8-EF seems to be suit for this purpose, they are not used at this time.
Changing mousekey keycodes seem to be better for backward compatibility. 0xD0-DF can be used for new mousekeys. Range C0-DF are already used for ACTION_LAYER_MODS
.
Note that this change requires Keymap Editor code fix.
This branch should be merged after Keymap Editor fix.
branch: https://github.com/tmk/tmk_keyboard/tree/mousekey_fix
https://github.com/tmk/tmk_keyboard/commit/cdf37f22e53ee1b1d79d3df50cbfc48ad9a65b72
These values should be changed to resolve conflict with mousekeys.
Value of enum layer_pram_tap_op
:
Action | Old | New |
---|---|---|
OP_TAP_TOGGLE | F0 | E8 |
OP_ON_OFF | F1 | E9 |
OP_OFF_ON | F2 | EA |
OP_SET_CLEAR | F3 | EB |
OP_MOMENTARY | F1 | E9 |
ACTION_MOUSEKEY()
is removed.
For example:
Old:
ACTION_MOUSEKEY(KC_MS_UP) = 0x50F0
where KC_MS_UP = 0xF0, ACTION_MOUSEKEY = 0x50
New:
ACTION_KEY(KC_MS_UP) = 0x00D0
where KC_MS_UP = 0xD0, ACTION_KEY = 0x00
Old | New |
---|---|
ACTION_MOUSEKEY(KC_MS_UP) | ACTION_KEY(KC_MS_UP) |
ACTION_MOUSEKEY(KC_MS_DOWN) | ACTION_KEY(KC_MS_DOWN) |
ACTION_MOUSEKEY(KC_MS_LEFT) | ACTION_KEY(KC_MS_LEFT) |
ACTION_MOUSEKEY(KC_MS_RIGHT) | ACTION_KEY(KC_MS_RIGHT) |
ACTION_MOUSEKEY(KC_MS_BTN1) | ACTION_KEY(KC_MS_BTN1) |
ACTION_MOUSEKEY(KC_MS_BTN2) | ACTION_KEY(KC_MS_BTN2) |
ACTION_MOUSEKEY(KC_MS_BTN3) | ACTION_KEY(KC_MS_BTN3) |
ACTION_MOUSEKEY(KC_MS_BTN4) | ACTION_KEY(KC_MS_BTN4) |
ACTION_MOUSEKEY(KC_MS_BTN5) | ACTION_KEY(KC_MS_BTN5) |
ACTION_MOUSEKEY(KC_MS_WH_UP) | ACTION_KEY(KC_MS_WH_UP) |
ACTION_MOUSEKEY(KC_MS_WH_DOWN) | ACTION_KEY(KC_MS_WH_DOWN) |
ACTION_MOUSEKEY(KC_MS_WH_LEFT) | ACTION_KEY(KC_MS_WH_LEFT) |
ACTION_MOUSEKEY(KC_MS_WH_RIGHT) | ACTION_KEY(KC_MS_WH_RIGHT) |
ACTION_MOUSEKEY(KC_MS_ACCEL0) | ACTION_KEY(KC_MS_ACCEL0) |
ACTION_MOUSEKEY(KC_MS_ACCEL1) | ACTION_KEY(KC_MS_ACCEL1) |
ACTION_MOUSEKEY(KC_MS_ACCEL2) | ACTION_KEY(KC_MS_ACCEL2) |
Translate actions above into new ones when Keymap Editor loads old keymap
ACTION_KEY(KC_MS_*) = 0xF0-FF
ACTION_MOUSEKEY(KC_MS_*) = 0x50F0-50FF
ACTION_MOUSEKEY
(0x50F0-50FF) should be translated into new ones(0x00F0-0x00FF) unconditionallyACTION_LAYER_TAP(x, KC_MS_UP(0xF0))
should be translated to ACTION_LAYER_TAP_TOGGLE(x)
in most casesACTION_LAYER_TAP(x, KC_MS_DOWN(0xF1))
should be translated to ACTION_LAYER_MOMENTARY(x)
in most casesThese actions in old keymap will not be handled correctly in Keymap Editor.
OP_* values need to be modified in Keymap Editor and after
All prebuilt files need to be updated when Keymap Editor is fixed.
Fixed with this commit: cdf37f22e53
Mousekeys work with ACTION_KEY()
, ACTION_MODS_KEY()
, ACTION_MODS_TAP_KEY()
now.
But not completely with ACTION_LAYER_TAP_KEY()
,
enum layer_param_bit_op { OP_TAP_TOGGLE
, OP_ON_OFF
, OP_OFF_ON
, OP_SET_CLEAR
}(F0-F3)
overlaps with mousekeys KC_MS_U
, KC_MS_D
, KC_MS_L
and KC_MS_R
partially.
These mousekeys won't be useful much and rarely used with the action, though.
Resolving this conflict breaks old keymap/firmware and it is not worth a lot of annoyance at this point.
ACT_MOUSEKEY
can be removed but kept for backward compatibility.
Keymap Editor:
ACTION_MOUSEKEY
is still needed for backward compatibility in Keymap Editor. Old firmwares do not support ACTION_KEY(mousekey)
.
Keycode of Mouse keys don't work with
ACTION_LAYER_TAP_KEY()
andACTION_MODS_TAP_KEY()
.https://github.com/tmk/tmk_keyboard/blob/06d354c06b473864ddc97ca347a6d4ffd00bbda3/tmk_core/common/keycode.h#L489-L507
register_code()
andunregister_code()
ignore Mouse keys(F0-FF) currently but they can be changed so that the codes are processed like System and Media keys.https://github.com/tmk/tmk_keyboard/blob/06d354c06b473864ddc97ca347a6d4ffd00bbda3/tmk_core/common/action.c#L446-L451
ACTION_MOUSEKEY() is not needed anymore
ACTION_MOUSEKEY()
can be used to define mouse actions but it is not needed once the[un]register_code()
are fixed. https://github.com/tmk/tmk_keyboard/blob/06d354c06b473864ddc97ca347a6d4ffd00bbda3/tmk_core/common/action_code.h#L232 https://github.com/tmk/tmk_keyboard/blob/dd316b990f4523c49a0d1eef677cee67318d123d/tmk_core/common/actionmap.h#L289-L305Mouse keys can be defined as normal keys,
ACTION_KEY(KC_MS_UP)
for example.So
ACTION_MOUSEKEY()
andACT_MOUSEKEY
can be removed from Action codes. https://github.com/tmk/tmk_keyboard/blob/06d354c06b473864ddc97ca347a6d4ffd00bbda3/tmk_core/common/action_code.h#L50-L51