-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue] Modifier does not work for other G-Keys #15
Comments
Hey, you really went to great lengths to investigate the issue. I really appreciate it. Currently the GKeys can't be used in combinations (G1+G2...) because the keyboard returns different hex values. As you can see here command_bytearray.py, every GKey is maped to a unique hex byte array. But when you press multiple GKeys or press and hold G1 and then press G2 the keyboard returns a completely different hex byte array. This is probably because it merges the two hex codes from G1 and G2 together (my guess is it does some kind of boolean operation on them). Because of this behavior the driver currently simply drops the hex code it receives because it does not know what to do with it. Implementing the decoding will be quite tedious but I hope I will find some time to code it in when I figure out how the Gkeys are actually merged. (Nothing is easy with Logitech on Linux :P) |
So I just found this project (which is awesome) and I saw this issue. # import binascii
# spaces added below
b'11 ff 08 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' # >>> binascii.hexlify(commands['g1'])
b'11 ff 08 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' # >>> binascii.hexlify(commands['g2'])
b'11 ff 08 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' # >>> binascii.hexlify(commands['g3'])
b'11 ff 08 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' # >>> binascii.hexlify(commands['g4'])
b'11 ff 08 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' # >>> binascii.hexlify(commands['g5'])
b'11 ff 08 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' # >>> binascii.hexlify(commands['g6'])
b'11 ff 08 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' # >>> binascii.hexlify(commands['g7'])
b'11 ff 08 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' # >>> binascii.hexlify(commands['g8'])
b'11 ff 08 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00' # >>> binascii.hexlify(commands['g9'])
b'11 ff 09 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' # >>> binascii.hexlify(commands['m1'])
b'11 ff 09 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' # >>> binascii.hexlify(commands['m2'])
b'11 ff 09 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' # >>> binascii.hexlify(commands['m3'])
b'11 ff 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' # >>> binascii.hexlify(commands['m1-3_key_release'])
b'11 ff 0a 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' # >>> binascii.hexlify(commands['mr'])
b'11 ff 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' # >>> binascii.hexlify(commands['mr-key_release']) Basically, at least for the Note I'm not sure how this would work for a For the I'm going to try this out when I get a chance, unless someone else wants to. I'll report back. |
Oh. It looks like someone in #32 already determined the values of the actual arrays produced from the key combos. I just combined it what I did, and it seems to be 'OR'ing it. I'll see if I can make a simple PR. If it's of any use, code I used is attached. |
Hi,
I want to use G5 a an "Hyper" Key, and all other keys G-keys defined as F-key (F13...F21). My main point is that I prefer to manage G-keys at application-level.
Note: Below was tested on XUbuntu 18.04.
I added in char_uinput_mapper.py :
My /etc/g910-gkeys/config.json contains the mapping of G1-G9 to F13-F21 (please see the comment for G8) :
I have added in my ~.Xmodmap :
So far so good, the
hyper
modifier works (tested under Emacs):G5-c
is seen asHyper-c
, etc...G5+CTRL+Windows+ALT+SHIFT-f
is seen asctrl-meta-super-hyper-shift-f
.For other g-keys (except G8/F20), I can also use ctrl-g1, shift-g1, meta-g1, ctrl+super+g1 etc, who return the correct codes (ctrl-F13, etc...).
The issue is for the "hyper" modifier (G5), when used with another G-KEY.
G5-G1 should return "Hyper-F13". It returns nothing.
More interesting: When used with another modifier (let say control), nothing is returned too:
ctrl-G5-G1, shift-G5-G1 etc... do not work.
Hope this will help,
br.
The text was updated successfully, but these errors were encountered: