-
Notifications
You must be signed in to change notification settings - Fork 216
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
Not working with Logitech MX Keys #617
Comments
This seems to be the same issue as #275 As a temporary "hack" I just modified
It's not a proper solution, but it does allow me to use my MX Keys for now... |
To follow up, the "hack" above was giving me some other issues. In the end I think it's something that is better fixed in xkeysnail. I posted the following issue with xkeysnail: In the meantime, as an equally disgusting temporary workaround I've manually patched my def is_keyboard_device(device):
"""Guess the device is a keyboard or not"""
capabilities = device.capabilities(verbose=False)
if "Logitech MX Keys" in device.name:
return True
if 1 not in capabilities:
return False
supported_keys = capabilities[1]
if Key.SPACE not in supported_keys or \
Key.A not in supported_keys or \
Key.Z not in supported_keys:
# Not support common keys. Not keyboard.
return False
if Key.BTN_MOUSE in supported_keys:
# Mouse.
return False
# Otherwise, its keyboard!
return True |
Awesome, disgusting or not if it solves the problem then it works. I will look at merging this into my fork of xkeysnail later! Thank you for digging into it! Also for roughly the past week a bug existed that caused my fork to give out the latest xkeysnail v0.4, you need v0.3, please backup your changes (rename for your folder) and re-clone the latest version of Kinto so that the proper held keys behavior will occur. (otherwise things like Alt-Tab may break) |
On my list of things to add to the configuration file is So we could just do:
I think having a long list of "valid" hardware devices in the config file itself would make a lot more sense than hard-coding them into the source. Then as we find more exception devices over time we can juse add more Open to suggestions on the naming. |
What is it about the MX that's preventing it from working though? Does it not have capability 1 or does it have a BTN_MOUSE buttons? The criteria is actually pretty simple... |
I think the issue is that the OS claims that the device has a BTN_MOUSE. The system says these are the device capabilities:
BTN_MOUSE translates to code 272 (which is in the list). I'm slightly confused by this, since the keyboard doesn't actually have any mouse buttons. This is a relatively standard keyboard, doesn't have a scrollwheel or anything like that. One possible explanation is that the keyboard is connected via one of those Logitech Unifying Receiver dongles. My Logitech mouse is also connected via the same dongle. Perhaps the device capabilities reported by the OS include all the capabilities of all the devices connected to the dongle. Either way, the main issue is that the device supposedly has a BTN_MOUSE so it's immediately disqualified as a keyboard. |
Yep, that's our problem. My fork already fixes this by changing how "what is a keyboard" is defined...
Highly plausible this is the issue. Is there a single /dev/input device vs one for the keyboard and mouse? Do mouse events come in on event when you test with |
Yea.. looking back it is sad that I have essentially forgotten to ever get around to adding the literally coded up fix here in this thread already lol. I am glad that you are picking it up though for your fork @joshgoebel that is really awesome! |
I now have an mx logitech keyboard btw. Will be testing with it soon. |
Got the same issue with my |
@rbreaves is there anything we can do to help with this? |
I'd like to bump this too. How's the best way to use MX Keys on Manjaro? I can see that joshgoebel/keyszer#19 is still open. Btw. My issue regarding "MX Keys identified as mouse" on the Manjaro forum, but unrelated to Kinto, has passed 1K views 💣: https://forum.manjaro.org/t/logitech-mx-keys-keyboard-identified-as-event-mouse-instead-of-event-kbd/83127 It's crazy that it's still the same issue, and havn't been patched. Sadly I don't have the proper skills to fix is in the Linux kernel or anything like that. But I've moved to MacOS on my work-machine, and really find it annoying to remember my "Ctrl"-skills, so Kinto.sh is starting to become a "must-have" util on my other workstation with Manjaro 😄 . I've also edited `/usr/lib/python3.10/site-packages/xkeysnail/input.py' and replaced: def is_keyboard_device(device):
"""Guess the device is a keyboard or not"""
capabilities = device.capabilities(verbose=False)
if 1 not in capabilities:
return False
supported_keys = capabilities[1]
if Key.SPACE not in supported_keys or \
Key.A not in supported_keys or \
Key.Z not in supported_keys:
# Not support common keys. Not keyboard.
return False
if Key.BTN_MOUSE in supported_keys:
# Mouse.
return False
# Otherwise, its keyboard!
return True with: def is_keyboard_device(device):
"""Guess the device is a keyboard or not"""
capabilities = device.capabilities(verbose=False)
if "Logitech MX Keys" in device.name:
return True
if 1 not in capabilities:
return False
supported_keys = capabilities[1]
if Key.SPACE not in supported_keys or \
Key.A not in supported_keys or \
Key.Z not in supported_keys:
# Not support common keys. Not keyboard.
return False
if Key.BTN_MOUSE in supported_keys:
# Mouse.
return False
# Otherwise, its keyboard!
return True Thank for the current workaround, rroels. I also installed xkeysnail manually and now the "active" status in the bottom corner of the Kinto.sh application stays as "active" (instead of jumping to "inactive). However, my Ctrl are not remapped, even though I've selected MacOS. |
I don't have that type of keyboard, so I can't test, but I'm wondering if my project (Toshy, an offshoot from Kinto) is affected by this issue. It uses class Devices:
@staticmethod
def is_keyboard(device):
"""Guess the device is a keyboard or not"""
capabilities = device.capabilities(verbose=False)
if 1 not in capabilities:
return False
supported_keys = capabilities[1]
qwerty = all(k in supported_keys for k in QWERTY)
az = all(k in supported_keys for k in A_Z_SPACE)
if qwerty and az:
return True
# Otherwise, its not a keyboard!
return False This should accept any device that has the necessary keys to be a "keyboard". Pretty sure that this is the problem with the if Key.BTN_MOUSE in supported_keys:
# Mouse.
return False If you were to comment out just the I feel like at least one user of Toshy had a Logitech MX Keys and their main issue was that they had the keyboard in Mac mode but it was being identified as a Windows keyboard. That may also explain why your Ctrl key doesn't seem to be in the right place, though from your description I'm not sure if your Opt/Cmd are swapped or there are no modifiers being remapped (which would indicate a different problem). There was another user with an MX Keys, and their main issue was using a German layout. So it seems that the device was at least working in general. You can try Toshy, but you'd need to stop Kinto and disable its auto-start feature, or there would be a conflict between them after installing. Toshy has both a script/command that will disable it from auto-starting when you log in, and a full uninstall option, so it's fairly easy to return to using Kinto by just enabling it and re-enabling its auto-start option. Open an issue on my repo if you're interested in talking about this. |
Describe the bug
On my Lenovo laptop, Kinto.sh works fine with the internal keyboard, as well as with other USB keyboards. However, it does not work for the Logitech MX Keys keyboard.
Kinto.sh seems to be running fine. The laptop's internal keyboard is properly remapped. However, nothing seems to be remapped for the external Logitech MX Keys keyboard.
As mentioned, I tried other USB keyboards and those worked fine.
Expected behavior
I expected keys on the Logitech MX Keys keyboard to be remapped, just like with any other keyboard.
Install Type: Bare Metal
Distro: Manjaro 21.2.2
DE: Gnome 41.3
Kinto Version: Kinto v1.2-11 build 6b3ea9a
Logs and service status do not seem to indicate any issues.
I rely on Kinto.sh so much that I'd be more than happy to help create the fix. However, I'm going to need some help in diagnosing the issue.
Please let me know if you need any other information.
The text was updated successfully, but these errors were encountered: