I can't use it with any remapping software e.g.(Kanata)
First of all, thank you for this amazing piece of software! This is exactly what I've been looking for on Windows for such a long time.
I'm using kanata and have pretty much remapped my entire keyboard with multiple layers. However, for some reason, I can't use mousemaster with virtual keys. For example, I have to use the original physical key to activate any mode. If I try to emulate the keypress or sequence using a kanata macro, it doesn't work. I’ve also tried AutoHotkey and PowerToys keyboard manager same result.
Here is kanata repo.
Hi @VimDie5el, thanks for the kind words!
I think Kanata and mousemaster are likely to conflict because they overlap quite a bit in functionality, especially when it comes to key remapping. Both tools do key remapping, what Kanata calls layers are referred to as modes in mousemaster. Just to give you an example, in the default config of mousemaster, we remap leftalt + ijkl to control the arrow keys.
That said, I'm curious to dig into this further. Could you share your Kanata config? Also, could you change the log level in mousemaster to show all key events? Just add the following line to your config file:
logging.level=TRACE
You should see lines like this one:
TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0xa2 (VK_LCONTROL), scanCode = 0x1d, flags = 0x0, wParam = WM_KEYDOWN
I'm interested to see what event mousemaster receives when you use Kanata to remap a key to something else. The order in which you start Kanata and mousemaster matters, as well as whether you start one of them in elevated mode (admin).
By the way, I love your nickname.
Hi @VimDie5el, thanks for the kind words!
I think Kanata and mousemaster are likely to conflict because they overlap quite a bit in functionality, especially when it comes to key remapping. Both tools do key remapping, what Kanata calls layers are referred to as modes in mousemaster. Just to give you an example, in the default config of mousemaster, we remap leftalt + ijkl to control the arrow keys.
That said, I'm curious to dig into this further. Could you share your Kanata config? Also, could you change the log level in mousemaster to show all key events? Just add the following line to your config file:
logging.level=TRACE
You should see lines like this one:
TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0xa2 (VK_LCONTROL), scanCode = 0x1d, flags = 0x0, wParam = WM_KEYDOWNI'm interested to see what event mousemaster receives when you use Kanata to remap a key to something else. The order in which you start Kanata and mousemaster matters, as well as whether you start one of them in elevated mode (admin).
By the way, I love your nickname.
Hello @petoncle, thank you for the quick response, glad you liked the name and got the joke
I see. This is my kanata config it's not really meant for anyone else to see, lol. It's a messy, but here you go.
;; defsrc is still necessary
(defcfg
process-unmapped-keys true
movemouse-inherit-accel-state yes
movemouse-smooth-diagonals yes
)
(defsrc
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
grv 1 2 3 4 5 6 7 8 9 0 - = bspc home
tab q w e r t y u i o p [ ] \ del
caps a s d f g h j k l ; ' ret pgup
lsft z x c v b n m , . / rsft up
lctl lmet lalt spc ralt rmet rctl left down right
)
(defvar
tap-time 200
hold-time 250
hold-time-slow 350
)
(defalias
;; REMAPS
cape (tap-hold $tap-time $hold-time esc (layer-toggle arrows))
ent (tap-hold $tap-time $hold-time ' enter)
[ (tap-hold $tap-time $hold-time [ bspc)
;; MACROS
enmo (macro S-RS-(20 c))
enmog (macro S-RS-(20 g))
vup (macro-repeat A-up)
vdw (macro-repeat A-down)
spo (macro A-S-C-t A-S-tab A-S-C-s)
;; HOME ROW MODS
a (tap-hold $tap-time $hold-time a lalt)
s (tap-hold $tap-time $hold-time s lsft)
d (tap-hold $tap-time $hold-time d lctl)
f (tap-hold $tap-time $hold-time-slow f lmet)
j (tap-hold $tap-time $hold-time-slow j rmet)
k (tap-hold $tap-time $hold-time k rctl)
l (tap-hold $tap-time $hold-time l rsft)
; (tap-hold $tap-time $hold-time ; ralt)
;; Media Controls
nex A-right
prv A-left
;; vup A-up
;; vdw A-down
pp C-spc
;; MULTI ACTIONS
mov (multi (layer-switch mouse) @enmo)
movg (multi (layer-switch mouse) @enmog)
capb (multi esc (layer-switch base))
;; LAYERS
bse (layer-switch base)
gam (layer-switch gaming)
mos (layer-switch mouse)
arr (layer-toggle arrows)
gwm (layer-toggle wm)
moa (layer-toggle media)
lam (tap-hold $tap-time $hold-time f3 @moa)
fwm (tap-hold $tap-time $hold-time f19 @gwm)
)
(deflayer base
_ _ _ _ _ _ _ _ _ _ _ _ @gam
_ _ _ _ _ _ _ _ _ _ _ - = @movg f17
_ _ _ _ _ _ _ _ _ _ _ @[ _ _ del
@cape @a @s @d @f _ _ @j @k @l @; _ _ f18
@lam _ _ _ _ _ _ _ _ _ _ bspc XX
f13 f15 @fwm _ _ _ _ XX XX XX
)
(deflayer arrows
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ - = _ f17
_ pgup _ pgdn C-tab _ _ _ _ _ _ @[ _ _ del
_ @a @s @d @f _ left down up right - _ _ f18
@lam _ _ _ _ _ _ _ _ _ _ bspc XX
_ f15 @fwm _ _ _ _ XX XX XX
)
(deflayer wm
_ _ _ _ _ _ _ _ _ _ _ _ @gam
_ _ _ _ _ _ _ _ _ _ _ - = @capb f17
_ A-c A-S-C-w A-S-C-e A-S-r _ _ _ _ _ _ @[ _ _ del
@cape A-S-C-b @spo A-d _ A-4 _ _ _ _ _ _ _ f18
@lam A-S-e _ A-S-C-d _ _ _ _ _ _ _ bspc XX
@capb f15 @fwm _ _ _ _ XX XX XX
)
(deflayer gaming
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 @bse
grv 1 2 3 4 5 6 7 8 9 0 - = f22 f17
tab q w e r t y u i o p [ ] \ del
lctl a s d f g h j k l ; ' ret f18
lsft z x c v b n m , . / bspc _
f3 f15 lalt spc ralt rmet rctl _ _ _
)
(deflayer mouse
_ _ _ _ _ _ _ _ _ _ _ _ @gam
_ _ _ _ _ _ _ _ _ _ _ - = @capb f17
_ _ _ _ _ _ _ _ _ _ _ @[ _ _ del
@capb _ _ _ _ @enmog _ _ _ _ _ _ _ f18
@lam _ _ _ _ _ _ _ _ _ _ bspc XX
@capb f15 @fwm _ _ _ _ XX XX XX
)
(deflayer media
_ _ _ _ _ _ _ _ _ _ _ _ @gam
_ _ _ _ _ _ _ _ _ _ _ - = _ f17
_ _ f23 @vup f21 _ _ _ _ _ _ @[ _ _ del
@cape _ @prv @vdw @nex _ @prv @vdw @vup @nex _ _ _ f18
@lam _ _ f20 _ _ _ _ _ _ _ bspc XX
_ f15 @fwm @pp _ _ _ XX XX XX
)
Here is the log when starting kanata (as admin) first, followed by mousemaster (also as admin).
❯ 2025-04-22T14:33:46.581+02:00 [main] INFO mousemaster.MousemasterApplication - mousemaster v76
2025-04-22T14:33:47.574+02:00 [main] INFO mousemaster.Mousemaster - Loaded configuration file mousemaster.properties with keyboard layout KeyboardLayout[identifier=00000809, displayName=United Kingdom, driverName=kbduk, shortName=uk-qwerty]
2025-04-22T14:33:47.704+02:00 [main] TRACE mousemaster.WindowsPlatform - Installed keyboard hook successfully
2025-04-22T14:33:47.704+02:00 [mouse-hook] TRACE mousemaster.WindowsPlatform - Installed mouse hook successfully
2025-04-22T14:33:49.522+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0xa2 (VK_LCONTROL), scanCode = 0x1d, flags = 0x0, wParam = WM_KEYDOWN
2025-04-22T14:33:49.522+02:00 [main] DEBUG mousemaster.ComboWatcher - currentMode = idle-mode, currentlyPressedComboKeys = [leftctrl], comboPreparation = [+leftctrl], partOfComboSequence = false, mustBeEaten = false, commandsToRun = []
2025-04-22T14:33:49.524+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x10, wParam = WM_KEYDOWN
2025-04-22T14:33:49.636+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0xa2 (VK_LCONTROL), scanCode = 0x1d, flags = 0x80, wParam = WM_KEYUP
2025-04-22T14:33:49.636+02:00 [main] DEBUG mousemaster.ComboWatcher - currentMode = idle-mode, currentlyPressedComboKeys = [], comboPreparation = [-leftctrl], partOfComboSequence = false, mustBeEaten = false, commandsToRun = []
2025-04-22T14:33:49.639+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x90, wParam = WM_KEYUP
2025-04-22T14:33:49.789+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0xa2 (VK_LCONTROL), scanCode = 0x1d, flags = 0x0, wParam = WM_KEYDOWN
2025-04-22T14:33:49.789+02:00 [main] DEBUG mousemaster.ComboWatcher - currentMode = idle-mode, currentlyPressedComboKeys = [leftctrl], comboPreparation = [+leftctrl], partOfComboSequence = false, mustBeEaten = false, commandsToRun = []
2025-04-22T14:33:49.792+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x10, wParam = WM_KEYDOWN
2025-04-22T14:33:49.921+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0xa2 (VK_LCONTROL), scanCode = 0x1d, flags = 0x80, wParam = WM_KEYUP
2025-04-22T14:33:49.921+02:00 [main] DEBUG mousemaster.ComboWatcher - currentMode = idle-mode, currentlyPressedComboKeys = [], comboPreparation = [-leftctrl], partOfComboSequence = false, mustBeEaten = false, commandsToRun = []
2025-04-22T14:33:49.925+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x90, wParam = WM_KEYUP
2025-04-22T14:33:50.191+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0xa2 (VK_LCONTROL), scanCode = 0x1d, flags = 0x0, wParam = WM_KEYDOWN
2025-04-22T14:33:50.191+02:00 [main] DEBUG mousemaster.ComboWatcher - currentMode = idle-mode, currentlyPressedComboKeys = [leftctrl], comboPreparation = [+leftctrl], partOfComboSequence = false, mustBeEaten = false, commandsToRun = []
2025-04-22T14:33:50.194+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x10, wParam = WM_KEYDOWN
2025-04-22T14:33:50.292+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0xa2 (VK_LCONTROL), scanCode = 0x1d, flags = 0x80, wParam = WM_KEYUP
2025-04-22T14:33:50.292+02:00 [main] DEBUG mousemaster.ComboWatcher - currentMode = idle-mode, currentlyPressedComboKeys = [], comboPreparation = [-leftctrl], partOfComboSequence = false, mustBeEaten = false, commandsToRun = []
2025-04-22T14:33:50.295+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x90, wParam = WM_KEYUP
2025-04-22T14:33:50.485+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0xa2 (VK_LCONTROL), scanCode = 0x1d, flags = 0x0, wParam = WM_KEYDOWN
2025-04-22T14:33:50.485+02:00 [main] DEBUG mousemaster.ComboWatcher - currentMode = idle-mode, currentlyPressedComboKeys = [leftctrl], comboPreparation = [+leftctrl], partOfComboSequence = false, mustBeEaten = false, commandsToRun = []
2025-04-22T14:33:50.487+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x10, wParam = WM_KEYDOWN
2025-04-22T14:33:50.588+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0xa2 (VK_LCONTROL), scanCode = 0x1d, flags = 0x80, wParam = WM_KEYUP
2025-04-22T14:33:50.588+02:00 [main] DEBUG mousemaster.ComboWatcher - currentMode = idle-mode, currentlyPressedComboKeys = [], comboPreparation = [-leftctrl], partOfComboSequence = false, mustBeEaten = false, commandsToRun = []
2025-04-22T14:33:50.591+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x90, wParam = WM_KEYUP
2025-04-22T14:33:51.374+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0xa2 (VK_LCONTROL), scanCode = 0x1d, flags = 0x0, wParam = WM_KEYDOWN
2025-04-22T14:33:51.374+02:00 [main] DEBUG mousemaster.ComboWatcher - currentMode = idle-mode, currentlyPressedComboKeys = [leftctrl], comboPreparation = [+leftctrl], partOfComboSequence = false, mustBeEaten = false, commandsToRun = []
2025-04-22T14:33:51.376+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x10, wParam = WM_KEYDOWN
2025-04-22T14:33:51.475+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0xa2 (VK_LCONTROL), scanCode = 0x1d, flags = 0x80, wParam = WM_KEYUP
2025-04-22T14:33:51.475+02:00 [main] DEBUG mousemaster.ComboWatcher - currentMode = idle-mode, currentlyPressedComboKeys = [], comboPreparation = [-leftctrl], partOfComboSequence = false, mustBeEaten = false, commandsToRun = []
2025-04-22T14:33:51.477+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x90, wParam = WM_KEYUP
Here, starting mousemaster (as admin) first, then kanata (also as admin).
❯ 2025-04-22T14:47:00.058+02:00 [main] INFO mousemaster.MousemasterApplication - mousemaster v76
2025-04-22T14:47:01.560+02:00 [main] INFO mousemaster.Mousemaster - Loaded configuration file mousemaster.properties with keyboard layout KeyboardLayout[identifier=00000809, displayName=United Kingdom, driverName=kbduk, shortName=uk-qwerty]
2025-04-22T14:47:01.692+02:00 [main] TRACE mousemaster.WindowsPlatform - Installed keyboard
hook successfully
2025-04-22T14:47:01.694+02:00 [mouse-hook] TRACE mousemaster.WindowsPlatform - Installed mouse hook successfully
2025-04-22T14:47:06.897+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x10, wParam = WM_KEYDOWN
2025-04-22T14:47:07.004+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x90, wParam = WM_KEYUP
2025-04-22T14:47:07.256+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x10, wParam = WM_KEYDOWN
2025-04-22T14:47:07.362+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x90, wParam = WM_KEYUP
2025-04-22T14:47:07.578+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x10, wParam = WM_KEYDOWN
2025-04-22T14:47:07.696+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x90, wParam = WM_KEYUP
2025-04-22T14:47:07.851+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x10, wParam = WM_KEYDOWN
2025-04-22T14:47:07.944+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x90, wParam = WM_KEYUP
2025-04-22T14:47:08.050+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x10, wParam = WM_KEYDOWN
2025-04-22T14:47:08.136+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x90, wParam = WM_KEYUP
2025-04-22T14:47:08.227+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x10, wParam = WM_KEYDOWN
2025-04-22T14:47:08.306+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x90, wParam = WM_KEYUP
2025-04-22T14:47:08.402+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x10, wParam = WM_KEYDOWN
2025-04-22T14:47:08.483+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x90, wParam = WM_KEYUP
2025-04-22T14:47:08.802+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x10, wParam = WM_KEYDOWN
2025-04-22T14:47:08.875+02:00 [main] TRACE mousemaster.WindowsPlatform - Received key event: vkCode = 0x7c (VK_F13), scanCode = 0x64, flags = 0x90, wParam = WM_KEYUP
It seems like starting kanata after the mousemaster registers the f13 key I made for the normal mode, but still I won't activate it and I know for a fact that f13 works when remapping it to control in the gk6+ (keyboard software). But kanata is better in alot of ways, so I don't use it.
So you make kanata generate a f13 key press event, and you'd like mousemaster to trigger the normal mode when that happens, but it currently doesn't do anything? Do I understand that correctly? Could you share your mousemaster config? Are you using interception with kanata?
So you make kanata generate a f13 key press event, and you'd like mousemaster to trigger the normal mode when that happens, but it currently doesn't do anything? Do I understand that correctly? Could you share your mousemaster config? Are you using interception with kanata?
Yes, I want to remap some keys on my keyboard to activate different mousemaster modes e.g.(left ctrl to f13, backspace to f14). f13 activate normal mode and f14 the hint mode and so on.
My mousemaster config is the default warpd one only changed the keybind for normal and hint mode + added the logging.level=TRACE.
logging.level=TRACE
# mousemaster will automatically convert the key aliases to your current keyboard layout.
# However, if you want to make a change to the key aliases, and your keyboard layout
# is not us-qwerty, then remove .us-qwerty
key-alias.hint1key.us-qwerty=q w e r t a s d f g z x c v b y u i o p h j k l ; n m , . /
key-alias.hint2key.us-qwerty=q w e r u i o p a s d f j k l ; z x c v m , . /
key-alias.extendedhint1key.us-qwerty=1 2 3 4 5 6 7 8 9 0 q w e r t y u i o p a s d f g h j k l ; z x c v b n m , . /
key-alias.extendedhint2key.us-qwerty=1 2 3 4 5 6 7 8 9 0 q w e r t y u i o p a s d f g h j k l ; z x c v b n m , . /
key-alias.hintscreenselectionkey.us-qwerty=j k l ; a s d f g
# When a mode is pushed onto the top of the history stack,
# other modes can refer to it using previous-mode-from-history-stack.
idle-mode.push-mode-to-history-stack=true
idle-mode.to.normal-mode=_{f13}
normal-mode.push-mode-to-history-stack=true
normal-mode.indicator.enabled=true
normal-mode.to.idle-mode=+esc | +c
normal-mode.mouse.initial-velocity=1600
normal-mode.mouse.max-velocity=2200
normal-mode.mouse.acceleration=1500
normal-mode.wheel.initial-velocity=1500
normal-mode.wheel.max-velocity=1000
normal-mode.wheel.acceleration=500
normal-mode.start-move.up=+k
normal-mode.start-move.down=+j
# Require that leftshift remains unpressed to not be executed when the snap.up combo (which
# uses leftshift) is executed.
normal-mode.start-move.left=^{leftshift} +h
normal-mode.start-move.right=^{leftshift} +l
normal-mode.stop-move.up=-k
normal-mode.stop-move.down=-j
normal-mode.stop-move.left=-h
normal-mode.stop-move.right=-l
# v is also used for starting the left button press because it is the drag mode toggle key
normal-mode.press.left=^{leftshift} +m | +n | +v
normal-mode.press.middle=+, | +minus
normal-mode.press.right=+. | +/
normal-mode.release.left=-m | -n
normal-mode.release.middle=-, | -minus
normal-mode.release.right=-. | -/
normal-mode.start-wheel.up=+r
normal-mode.start-wheel.down=+e
# Original warpd does not have wheel left and right commands, these are extra:
normal-mode.start-wheel.left=+w
normal-mode.start-wheel.right=+t
normal-mode.stop-wheel.up=-r
normal-mode.stop-wheel.down=-e
normal-mode.stop-wheel.left=-w
normal-mode.stop-wheel.right=-t
# Invisible grid used for snapping to the screen's edges
normal-mode.grid.area=active-screen
normal-mode.grid.area-width-percent=0.99
normal-mode.grid.area-height-percent=0.99
normal-mode.grid.row-count=1
normal-mode.grid.column-count=1
# Require that leftalt remains unpressed
normal-mode.snap.up=^{leftalt} _{leftshift} +h
normal-mode.snap.down=_{leftshift} +l
normal-mode.snap.left=+0
normal-mode.snap.right=_{leftshift} +4
normal-mode.move-to-grid-center=_{leftshift} +m
normal-mode.remapping.copy=+c -> +leftctrl +c -c -leftctrl
normal-mode.to.accelerated-mode=+a
accelerated-mode.to.normal-mode=-a
# Copy the indicator configuration from normal-mode
accelerated-mode.indicator=normal-mode.indicator
# Copy the mouse configuration from normal-mode and refine it
accelerated-mode.mouse=normal-mode.mouse
accelerated-mode.mouse.max-velocity=4500
accelerated-mode.mouse.acceleration=3000
accelerated-mode.wheel.max-velocity=10000
accelerated-mode.wheel.acceleration=10000
accelerated-mode.start-move=normal-mode.start-move
accelerated-mode.stop-move=normal-mode.stop-move
accelerated-mode.start-wheel=normal-mode.start-wheel
accelerated-mode.stop-wheel=normal-mode.stop-wheel
accelerated-mode.press=normal-mode.press
accelerated-mode.release=normal-mode.release
accelerated-mode.grid=normal-mode.grid
accelerated-mode.snap=normal-mode.snap
accelerated-mode.move-to-grid-center=normal-mode.move-to-grid-center
normal-mode.to.decelerated-mode=+d
decelerated-mode.to.normal-mode=-d
decelerated-mode.indicator=normal-mode.indicator
decelerated-mode.mouse=normal-mode.mouse
decelerated-mode.mouse.max-velocity=250
decelerated-mode.wheel.max-velocity=200
decelerated-mode.start-move=normal-mode.start-move
decelerated-mode.stop-move=normal-mode.stop-move
decelerated-mode.start-wheel=normal-mode.start-wheel
decelerated-mode.stop-wheel=normal-mode.stop-wheel
decelerated-mode.press=normal-mode.press
decelerated-mode.release=normal-mode.release
decelerated-mode.grid=normal-mode.grid
decelerated-mode.snap=normal-mode.snap
decelerated-mode.move-to-grid-center=normal-mode.move-to-grid-center
normal-mode.to.drag-mode=-v
drag-mode.to.normal-mode=+v -v | ^{leftshift} -m | -, | -.
drag-mode.to.idle-mode=+esc | +c
drag-mode.indicator=normal-mode.indicator
drag-mode.mouse=normal-mode.mouse
drag-mode.start-move=normal-mode.start-move
drag-mode.stop-move=normal-mode.stop-move
drag-mode.press.left=+m
drag-mode.press.middle=+,
drag-mode.press.right=+.
# When switching back to normal mode or idle mode,
# the left button should be released.
drag-mode.release.left=+esc | +v | ^{leftshift} -m | -, | -.
drag-mode.release.middle=-,
drag-mode.release.right=-.
drag-mode.grid=normal-mode.grid
drag-mode.snap=normal-mode.snap
drag-mode.move-to-grid-center=normal-mode.move-to-grid-center
drag-mode.remapping=normal-mode.remapping
normal-mode.to.oneshot-mode=-n | -minus | -/
oneshot-mode.to.idle-mode=+esc
oneshot-mode.indicator=normal-mode.indicator
# The user has 250ms to perform a double click in
# oneshot mode before we go back to idle mode.
oneshot-mode.timeout.duration-millis=250
oneshot-mode.timeout.mode=idle-mode
oneshot-mode.press=normal-mode.press
oneshot-mode.release=normal-mode.release
idle-mode.to.grid-mode=_{leftalt} +g
normal-mode.to.grid-mode=+g
grid-mode.to.oneshot-mode=-n | -minus | -/
grid-mode.to.idle-mode=+esc
grid-mode.to.normal-mode=+c -c
grid-mode.grid.area=active-screen
grid-mode.grid.area-width-percent=1.0
grid-mode.grid.area-height-percent=1.0
grid-mode.grid.synchronization=mouse-follows-grid-center
grid-mode.grid.line-visible=true
grid-mode.grid.line-color=#FF0000
# u, i, j, k are used for multiple commands.
# For example, u shrinks the grid both up and left.
grid-mode.shrink-grid.up=_{leftshift} +w | +u | +i
grid-mode.shrink-grid.down=_{leftshift} +s | +j | +k
grid-mode.shrink-grid.left=_{leftshift} +a | +u | +j
grid-mode.shrink-grid.right=_{leftshift} +d | +i | +k
grid-mode.move-grid.up=^{leftshift} +w
grid-mode.move-grid.down=^{leftshift} +s
grid-mode.move-grid.left=^{leftshift} +a
grid-mode.move-grid.right=^{leftshift} +d
grid-mode.press=normal-mode.press
grid-mode.release=normal-mode.release
# Require that leftshift remains unpressed
idle-mode.to.hint1-mode=_{f14}
normal-mode.to.hint1-mode=+x
hint1-mode.to.previous-mode-from-history-stack=+esc | +backspace
hint1-mode.hide-cursor.enabled=true
hint1-mode.hint.type=grid
hint1-mode.hint.grid-area=active-screen
hint1-mode.hint.active-screen-grid-area-center=screen-center
hint1-mode.hint.grid-cell-width=74
hint1-mode.hint.grid-cell-height=36
hint1-mode.hint.layout-row-count=6
hint1-mode.hint.layout-column-count=5
hint1-mode.hint.selection-keys=hint1key
hint1-mode.hint.font-name=Segoe UI
hint1-mode.hint.prefix-box-enabled=true
hint1-mode.hint.prefix-in-background=true
hint1-mode.hint.prefix-font-name=Segoe UI Light
hint1-mode.hint.prefix-font-size=120
hint1-mode.hint.prefix-font-color=#FFD93D
hint1-mode.hint.prefix-font-opacity=0.8
hint1-mode.hint.prefix-font-shadow-opacity=0
hint1-mode.hint.selected-font-opacity=0.5
# Hint configuration for a 4K screen:
hint1-mode.hint.grid-cell-width.3840x2160=96
hint1-mode.hint.grid-cell-height.3840x2160=54
hint1-mode.hint.layout-row-count.3840x2160=4
hint1-mode.hint.layout-column-count.3840x2160=10
hint1-mode.hint.selection-keys.3840x2160=extendedhint1key
# Hint configuration for a QHD screen:
hint1-mode.hint.grid-cell-width.2560x1440=64
hint1-mode.hint.grid-cell-height.2560x1440=36
hint1-mode.hint.layout-row-count.2560x1440=4
hint1-mode.hint.layout-column-count.2560x1440=10
hint1-mode.hint.selection-keys.2560x1440=extendedhint1key
# Hint configuration for a UWQHD screen:
hint1-mode.hint.grid-cell-width.3440x1440=86
hint1-mode.hint.grid-cell-height.3440x1440=36
hint1-mode.hint.layout-row-count.3440x1440=4
hint1-mode.hint.layout-column-count.3440x1440=10
hint1-mode.hint.selection-keys.3440x1440=extendedhint1key
hint1-mode.hint.undo=backspace
hint1-mode.hint.mode-after-selection=previous-mode-from-history-stack
hint1-mode.hint.save-position-after-selection=true
idle-mode.to.hint2-1-mode=+leftshift-0 +leftalt-0 +x | +leftalt-0 +leftshift-0 +x
normal-mode.to.hint2-1-mode=_{leftshift} +x
hint2-1-mode.to.previous-mode-from-history-stack=+esc | +backspace
hint2-1-mode.hide-cursor=hint1-mode.hide-cursor
hint2-1-mode.hint=hint1-mode.hint
hint2-1-mode.hint.mode-after-selection=hint2-2-mode
hint2-1-mode.hint.save-position-after-selection=false
hint2-2-mode.to.previous-mode-from-history-stack=+esc
hint2-2-mode.to.hint2-1-mode=+backspace
hint2-2-mode.hide-cursor=hint1-mode.hide-cursor
hint2-2-mode.hint=hint1-mode.hint
hint2-2-mode.hint.active-screen-grid-area-center=last-selected-hint
hint2-2-mode.hint.grid-max-row-count=3
hint2-2-mode.hint.grid-max-column-count=8
hint2-2-mode.hint.grid-cell-width=50
hint2-2-mode.hint.grid-cell-height=75
hint2-2-mode.hint.selection-keys=hint2key
hint2-2-mode.hint.prefix-in-background=false
hint2-2-mode.hint.prefix-box-enabled=false
# Hint configuration for a 4K screen:
hint2-2-mode.hint.grid-max-row-count.3840x2160=4
hint2-2-mode.hint.grid-max-column-count.3840x2160=10
hint2-2-mode.hint.grid-cell-width.3840x2160=48
hint2-2-mode.hint.grid-cell-height.3840x2160=67.5
hint2-2-mode.hint.selection-keys.3840x2160=extendedhint2key
# Hint configuration for a QHD screen:
hint2-2-mode.hint.grid-max-row-count.2560x1440=4
hint2-2-mode.hint.grid-max-column-count.2560x1440=10
hint2-2-mode.hint.grid-cell-width.2560x1440=32
hint2-2-mode.hint.grid-cell-height.2560x1440=45
hint2-2-mode.hint.selection-keys.2560x1440=extendedhint2key
# Hint configuration for a UWQHD screen:
hint2-2-mode.hint.grid-max-row-count.3440x1440=4
hint2-2-mode.hint.grid-max-column-count.3440x1440=10
hint2-2-mode.hint.grid-cell-width.3440x1440=43
hint2-2-mode.hint.grid-cell-height.3440x1440=45
hint2-2-mode.hint.selection-keys.3440x1440=extendedhint2key
hint2-2-mode.zoom.percent=5.0
hint2-2-mode.zoom.center=last-selected-hint
hint2-2-mode.hint.mode-after-selection=previous-mode-from-history-stack
idle-mode.to.hint1-then-click-mode=^{leftshift} _{leftalt} +l
hint1-then-click-mode.to.previous-mode-from-history-stack=+esc | +backspace
hint1-then-click-mode.hint=hint1-mode.hint
# Click left button when a hint has been selected
hint1-then-click-mode.hint.mode-after-selection=click-after-hint1-mode
hint1-then-click-mode.hint.swallow-hint-end-key-press=false
click-after-hint1-mode.press.left=+hint1key
click-after-hint1-mode.release.left=+hint1key-0-250 -hint1key
click-after-hint1-mode.timeout.duration-millis=250
click-after-hint1-mode.timeout.mode=previous-mode-from-history-stack
# After a hint is selected, quickly press the same last hint key again to perform a second click.
# We switch the mode to itself to reset the timeout and be able to click again using the hint key.
# Timeout will not be triggered if left button is pressed. We force the switch to normal mode when pressing for over 250ms.
click-after-hint1-mode.to.normal-mode=+hint1key-250 -hint1key
idle-mode.to.hint2-1-then-click-mode=+leftshift-0 +leftalt-0 +l | +leftalt-0 +leftshift-0 +l
hint2-1-then-click-mode.to.previous-mode-from-history-stack=+esc | +backspace
hint2-1-then-click-mode.hint=hint2-1-mode.hint
hint2-1-then-click-mode.hint.mode-after-selection=hint2-2-then-click-mode
hint2-2-then-click-mode.to.previous-mode-from-history-stack=+esc
hint2-2-then-click-mode.to.hint2-1-then-click-mode=+backspace
hint2-2-then-click-mode.zoom=hint2-2-mode.zoom
hint2-2-then-click-mode.hide-cursor=hint1-mode.hide-cursor
hint2-2-then-click-mode.hint=hint2-2-mode.hint
# Click left button when a hint has been selected
hint2-2-then-click-mode.hint.mode-after-selection=click-after-hint2-mode
hint2-2-then-click-mode.hint.swallow-hint-end-key-press=false
click-after-hint2-mode.press.left=+hint2key
click-after-hint2-mode.release.left=+hint2key-0-250 -hint2key
click-after-hint2-mode.timeout.duration-millis=250
click-after-hint2-mode.timeout.mode=previous-mode-from-history-stack
click-after-hint2-mode.to.click-after-hint2-mode=+hint2key-0-250 -hint2key
click-after-hint2-mode.to.normal-mode=+hint2key-250 -hint2key
idle-mode.to.screen-selection-mode=_{leftalt} +s
normal-mode.to.screen-selection-mode=+s
screen-selection-mode.to.previous-mode-from-history-stack=+esc
screen-selection-mode.hint.type=grid
screen-selection-mode.hint.grid-area=all-screens
screen-selection-mode.hint.grid-max-row-count=1
screen-selection-mode.hint.grid-max-column-count=1
screen-selection-mode.hint.selection-keys=hintscreenselectionkey
screen-selection-mode.hint.font-size=120
screen-selection-mode.hint.mode-after-selection=previous-mode-from-history-stack
screen-selection-mode.hint.save-position-after-selection=true
idle-mode.to.position-history-mode=_{leftalt} +h
idle-mode.position-history.save-position=_{leftalt} +h
normal-mode.to.position-history-mode=+; -;
normal-mode.position-history.save-position=+; -;
position-history-mode.to.previous-mode-from-history-stack=+esc | +backspace | +; -;
key-alias.positionhistoryhintkey=h j k l a s d f
# Refresh the hints when they have been changed.
position-history-mode.to.position-history-mode=+positionhistoryhintkey | +positionhistoryhintkey-500 | +;-500
# Clear the position history when ; is pressed and held for 500ms (0.5s).
position-history-mode.position-history.clear=+;-500
# Save the current position when pressing one of the selection keys.
position-history-mode.position-history.save-position=+positionhistoryhintkey
# Unsave a previously saved position when pressing one of the selection keys for 500ms.
position-history-mode.position-history.unsave-position=+positionhistoryhintkey-500
position-history-mode.hint=hint1-mode.hint
position-history-mode.hint.font-size=30
position-history-mode.hint.type=position-history
position-history-mode.hint.mode-after-selection=position-history-mode
position-history-mode.hint.swallow-hint-end-key-press=false
position-history-mode.hint.selection-keys=positionhistoryhintkey
normal-mode.position-history.cycle-next=_{leftctrl} +i
normal-mode.position-history.cycle-previous=_{leftctrl} +o
No, I'm not using interception with kanata. Do you think I should?
I was able to confirm that the problem comes from: https://github.com/petoncle/mousemaster/blob/75a20902caca63e3144112d6e7f5c2eeef7f0a4a/src/main/java/mousemaster/WindowsPlatform.java#L298-L301
mousemaster ignores the f13 key event because it has this special Windows flag that means it is not an event generated by a real physical press of the f13 key. The question is: is it safe to not ignore those events? I'm not sure, it's possible weird things could happen if mousemaster generates an event and then receives that event (feedback loop). We could add a command line argument to mousemaster or something that would allow you to not ignore those events, and you could try it and see if it works.
I was able to confirm that the problem comes from:
mousemaster/src/main/java/mousemaster/WindowsPlatform.java
Lines 298 to 301 in 75a2090 if ((info.flags & ExtendedUser32.LLKHF_INJECTED) == ExtendedUser32.LLKHF_INJECTED) { // SendInput from another app (or from mousemaster). }
mousemaster ignores the f13 key event because it has this special Windows flag that means it is not an event generated by a real physical press of the f13 key. The question is: is it safe to not ignore those events? I'm not sure, it's possible weird things could happen if mousemaster generates an event and then receives that event (feedback loop). We could add a command line argument to mousemaster or something that would allow you to not ignore those events, and you could try it and see if it works.
I don't think that's the issue, because I tried using the default combo to activate normal mode with kanata, and it didn’t work.
Try remapping any key on your keyboard with Left Alt, then try activating any mode it won’t work. I even tried it with kanata macros, and it still didn’t work.
I tried using the default combo to activate normal mode with kanata, and it didn’t work.
From what I understand, any key event that is generated by kanata (or any other tool that generates keyboard events) is marked by Windows with a flag that says "this is not a physical event, it was generated by an app". Any such event is currently ignored by mousemaster, which would explain why mousemaster isn't reacting to those events. Do you understand it differently?
I tried using the default combo to activate normal mode with kanata, and it didn’t work.
From what I understand, any key event that is generated by kanata (or any other tool that generates keyboard events) is marked by Windows with a flag that says "this is not a physical event, it was generated by an app". Any such event is currently ignored by mousemaster, which would explain why mousemaster isn't reacting to those events. Do you understand it differently?
Yeah, I misunderstood what you said earlier my bad. Anyway, to fix this, we could either add a command-line argument to allow those events or compile a separate binary for users who want to enable them, right?
we could either add a command-line argument to allow those events or compile a separate binary for users who want to enable them, right?
That's what I had in mind too. Check out this branch: https://github.com/petoncle/mousemaster/compare/main...ignore-injected-events-flag
I have added a command line argument to do some testing. Usage:
mousemaster.exe --ignore-injected-events=false
I wanted to attach a build of that branch, but GitHub refuses the file even when I zip it. I've uploaded it to an external service: https://gofile.io/d/KYAxwu You can also build it yourself if you prefer.
we could either add a command-line argument to allow those events or compile a separate binary for users who want to enable them, right?
That's what I had in mind too. Check out this branch: main...ignore-injected-events-flag
I have added a command line argument to do some testing. Usage:
mousemaster.exe --ignore-injected-events=falseI wanted to attach a build of that branch, but GitHub refuses the file even when I zip it. I've uploaded it to an external service: https://gofile.io/d/KYAxwu You can also build it yourself if you prefer.
Yeah, I can confirm this works, but I have to start mousemaster before kanata, or it will register the original key before the remapped one.
Great, thanks for trying it. I need to test it out myself. I'm guessing the key remapping features in mousemaster won't work well, but I'll need to check.
Great, thanks for trying it. I need to test it out myself. I'm guessing the key remapping features in mousemaster won't work well, but I'll need to check.
I have a new update: I installed kanata with Interception, and it works without the command-line argument. The order doesn't seem to matter either, so I think it's better for me to use it without --ignore-injected-events=false for now. Still, this might be useful for anyone using another remapping software. Thanks again for taking the time to look into it.
I have a new update: I installed kanata with Interception, and it works without the command-line argument.
I tried the interception driver, but because of the limitations (10 connects) it did not work for me. Are you still using the interception driver -- without problems?