zocker-160 / keyboard-center

Application for mapping macro keys on Logitech keyboards
GNU General Public License v3.0
65 stars 2 forks source link

Keyboard fails to disable default GKey mapping when rebooting from Windows #24

Closed zocker-160 closed 2 years ago

zocker-160 commented 2 years ago

original complaint: https://github.com/zocker-160/keyboard-center/issues/21#issuecomment-1038356536

Driver used on Windows is Logitech Gaming Software but it probably also affects GHub users. Keyboard affected: G910

zocker-160 commented 2 years ago

I have updated the debugger script so we can try to debug this problem easier, could you please try the following:

I am now sending a keyboard reset command and a different disable mapping command. For me it works every time.

Corionis commented 2 years ago

Performed those steps. Did NOT un-power the keyboard when rebooting back to Linux.

Here is the output, but it does not actually do anything and the M1-4 keys do not change.

G-Keys 1-9 pressed and released ...

$ python3 src/newDeviceDebugger.py 
DEBUG: Searching for keyboard...
DEBUG: Keyboard found! :)
DEBUG: requesting USB endpoint...
DEBUG: HIDraw read endpoint found: /dev/hidraw3
DEBUG: HIDraw disable endpoint found: /dev/hidraw3
DEBUG: Checking for HID availability...
DEBUG: Connected to /dev/hidraw3
INFO: starting listener...
DEBUG: Using selector: EpollSelector
DEBUG: Connection using HIDAPI...
DEBUG: Sending sequence to disable G keys
0: b'\x11\xff\x10>\x00\x04\x00\x00\x00\x00\x00\x00\xd0\x01d\x07\x00\x00\x00\x00'
1: b'\x11\xff\x08.\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
DEBUG: listening to USB Interface (1, 0) | b'/dev/hidraw3'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x02\x00'
got data from keyboard: b'\x11\xff\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08.\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x02\x00'
got data from keyboard: b'\x11\xff\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08.\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x11\xff\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
zocker-160 commented 2 years ago

hey this is looking good! I hope the soft reset command is the solution.

alright new version with the new fix (rename .zip to .deb - GitHub does not allow upload of .deb....) keyboard-center_0.1.28-1_amd64.zip

EDIT: just install, restart background service and then try the Windows -> Linux reboot again

zocker-160 commented 2 years ago

(no idea why this got closed)

Corionis commented 2 years ago

It appears to be working pretty well with 1.28-1.

A couple of things:

  1. From Windows back to Linux worked the first time.
  2. As a test I powered-off / unplugged everything and did a cold boot - oddly that failed.
  3. Booted Windows, then shutdown (but did not power off), and booted Linux - that worked.

Instead of multi-booting hard drives I use an internal SSD dock and physically swap boot drives. Had Windows stomp on my Linux, twice.

Question: To be safe I uninstalled the prior version before installing 1.28-1. Just wondering if that's necessary or whether the .deb package will upgrade itself?

I'll live with it a while and let you know if there are any consistent problems.

Thank you very much for fixing this and your hard work on this cool tool.

zocker-160 commented 2 years ago

thank you for the feedback!

Glad the soft reset seems to work most of the time, why it failed for the cold boot is weird, I will try to reproduce that.

Question: To be safe I uninstalled the prior version before installing 1.28-1. Just wondering if that's necessary or whether the .deb package will upgrade itself?

you don't need to, apt will handle all of that for you and detect that you are upgrading in case on older version is already installed (so you can just do apt install ./xxx.deb) EDIT: in case more steps are needed, I always write that into the update notes (sometimes a reboot is necessary)

I'll live with it a while and let you know if there are any consistent problems.

yes pls let me know if there are issues, I sadly cannot do long term testing :)

zocker-160 commented 2 years ago

since there has not been any update or complaint about this for quite some time now, I will close this.

Feel free to reopen or create a new issue, if you still encounter problems.