nickbclifford / gkeybind

A Linux utility for binding custom behavior to Logitech keyboards.
GNU General Public License v3.0
19 stars 0 forks source link

Cannot bind G keys to F13-F24 #4

Closed xurei closed 3 years ago

xurei commented 3 years ago

When I try to bind G1 to F13, the program crashes.

Also, a list of compatible keys should be useful in the README :-)

My config :

actions:
  g1:
    - keys: F13
  g2:
    - text: You've installed gkeybind correctly!
  g3:
    - text: Modify /etc/gkeybind.yml to set your own bindings.

Error message :

Unhandled exception: Missing hash key: 65482 (KeyError)
  from ???
  from __crystal_main
  from main
  from __libc_start_main
  from _start
  from ???
nickbclifford commented 3 years ago

This appears to be an issue with keyboard layouts - it seems like at least on my machine, no default layout contains key code information for the F13-F24 keys. At the very least, I'll work on making a better error message right now.

How is your keyboard configured? Unfortunately I don't have a keyboard that has F13-F24 keys, so I can't test myself, but I'm curious to see how yours works on your system.

xurei commented 3 years ago

My configuration is pretty standard. I have a FR layout, and no F13-F24 keys either. It is a G815.

However, these keys exists in the kernel headers (see https://gist.github.com/MightyPork/6da26e382a7ad91b5496ee55fdc73db2). I wanted to map G1-G5 to them. But I guess as they don't actually exist on my keyboard, the OS is not loading them on the keyboard mapping.

I think that in order to make this work without hacking into xmodmap, some refactoring will be necessary. Maybe not worth it... Your call :-)

nickbclifford commented 3 years ago

Yep, you've got it - I'll take a look, it might be possible to configure with special xkb layout configs, so I'll look into adding further layout configuration support.

nickbclifford commented 3 years ago

I've updated the documentation and pushed a new version with better layout support. Thanks for letting me know about the issue!