Open OnFireByte opened 5 months ago
Hi @OnFireByte,
To help a future reader, what is the minimal configuration that reproduces the behaviour?
process-unmapped-keys yes
?Also, does karabiner elements reproduce the same or does karabiner work as intended?
Hi @OnFireByte,
To help a future reader, what is the minimal configuration that reproduces the behaviour?
- Are you mapping f1-f12 in defsrc?
- Are you using
process-unmapped-keys yes
?Also, does karabiner elements reproduce the same or does karabiner work as intended?
process-unmapped-keys yes
, I already try removing it, but the problem still occurredI also ran into this issue, and it happens with or without process-unmapped-keys yes
.
It can be reproduced using simple configs like: https://github.com/jtroo/kanata/blob/main/cfg_samples/minimal.kbd
A related question is: what is the defsrc
key code for the fn
key?
The below is what Karabiner EventViewer reports when the fn key is pressed.
[
{
"type": "down",
"name": {"apple_vendor_top_case_key_code":"keyboard_fn"},
"usagePage": "255 (0x00ff)",
"usage": "3 (0x0003)",
"misc": "flags fn"
},
{
"type": "up",
"name": {"apple_vendor_top_case_key_code":"keyboard_fn"},
"usagePage": "255 (0x00ff)",
"usage": "3 (0x0003)",
"misc": ""
},
]
The fn key is
fn
.
Thank you very much! Would be nice to update https://github.com/jtroo/kanata/blob/main/cfg_samples/all_keys_in_defsrc.kbd to include fn
as well!
@jtroo Thanks for the pointer to the file https://github.com/jtroo/kanata/blob/b1e828b4cda220eda3bc4e0aef2f9afba5fc9b4f/parser/src/keys/mod.rs and it was super helpful for me to find many keycodes I needed.
I was able to resolve the issue by explicit handling the F-key row and the fn
key. CC @OnFireByte
I.e.
;; add this row to your defsrc. Need to add the fn key as well.
(defsrc
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
...
...
fn
)
;; then you can create a fn layer. E.g. mine is:
(deflayer fn
_ brdn brup _ _ _ _ _ _ _ mute vold volu
...
)
;; then map your fn key to `fnl` as shown below.
(defalias
fnl (layer-while-held fn)
)
The reason why I believe this is needed is because Karabiner also handles the F-keys explicitly. See attached screenshot:
Update:
In case you tap the fn
key to switch layout like me, this is even better:
(defalias
fnl (tap-hold 200 200 fn (layer-toggle fn))
)
It would still be nice to fix the bug--looks like the fn
key code is not available on Windows, so having fn
in defsrc
breaks my configs compatibility in Windows.
A working minimal configuration
(defsrc
f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
fn
)
(defalias
fnl (tap-hold 200 200 fn (layer-toggle fn))
)
(deflayer base
f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
@fnl
)
;; Some keys are missing: `Mission Control`, `Launchpad`, `dictation`, ` Do Not Disturb`
(deflayer fn
brdn brup _ _ _ _ prev pp next mute vold volu
_
)
EDIT:
(defalias
fnl (tap-hold 200 200 fn (layer-toggle fn))
)
for being able to also switch languages. Thanks @yzhuang !!
Did anyone manage to find out the keycodes for Mission Control? I can live without spotlight (f4), dictation (f5), and do not disturb (f6) keys. But f3 (Mission Control) is something I would like to still retain.
Did anyone manage to find out the keycodes for Mission Control? I can live without spotlight (f4), dictation (f5), and do not disturb (f6) keys. But f3 (Mission Control) is something I would like to still retain.
Mission Control is by default ctrl+up arrow, so you could map it to that.
Check System Settings > Keyboard > Keyboard Shortcuts to see if it still is that, and you can find Do Not Disturb and Spotlight are, I didn’t see Dictation but it might be in there somewhere too.
Requirements
Describe the bug
In my macbook, F-row get override to normal f1-f12 instead of normal feature (light control, sound control) when kanata is used.
This also happen when I try to turn on the "swap f-row to feature" setting (Image below), fn key + F-row key will still result in normal f1-f12
Relevant kanata config
No response
To Reproduce
driver_activated 1
Expected behavior
It shouldn't override anything.
Kanata version
kanata 1.6.0 (arm64, cmd allowed)
Debug logs
Happen when I press F12 (increase volume)
Operating system
MacOS (arm64)
Additional context
No response