WeirdTreeThing / cros-keyboard-map

Utility to generate keyd configurations for use on Chromebooks
BSD 3-Clause "New" or "Revised" License
33 stars 10 forks source link

Numlock option? #16

Open a-hurst opened 3 months ago

a-hurst commented 3 months ago

Hi WTT,

Not sure if this is something better handled outside of keyd so bear with me, but is it possible to add an option to remap the numpad keys to regular keys? I had to do this manually in keyd on my Chromebooks because (as far as I could find) there's no way to toggle NumLock in BIOS on these machines, toggling the setting in KDE doesn't do anything, and the keyd virtual device prevents the CLI numlock toggle commands I could find from working. This is the relevant part of my keyd config, all the other numpad keys work fine without remapping:

# - Numlock stuck on with Fedora KDE, so remap numpad to regular keys
kp0 = 0
kp1 = 1
kp2 = 2
kp3 = 3
kp4 = 4
kp5 = 5
kp6 = 6
kp7 = 7
kp8 = 8
kp9 = 9
kpdot = .

I know there aren't that many Chromebooks out there with a number pad, but it'd be a handy feature for the few that exist.

Thanks in advance!

WeirdTreeThing commented 3 months ago

Have you tried mapping a certain key sequence to numlock in your keyd config?

a-hurst commented 3 months ago

Just tried it, and it does work, but NumLock state doesn't persist after a reboot since it's not actually saved in firmware, meaning it needs to be toggled every boot. I also tried the installing the latest keyd version from source which has some numlock-related fixes in the changelog, but KDE's "Turn Numlock off on boot" setting still doesn't work regardless.

Some more digging reveals that a number of people are having trouble with the "Numlock=off" setting for KDE/SDDM though, so that might be a Wayland issue moreso than a Chromebook-specific problem. If that's the case it's probably better fixed at that level than here.

WeirdTreeThing commented 3 months ago

There must be something with keyd and numlock. TBH the best option is probably to set numlock on every boot with the special mapping in keyd. If you have a suggestion for what I should set it to let me know.