Skip to content

Instantly share code, notes, and snippets.

@jnettlet
Last active June 25, 2024 14:35
Show Gist options
  • Save jnettlet/afb20a048b8720f3b4eb8506d8b05643 to your computer and use it in GitHub Desktop.
Save jnettlet/afb20a048b8720f3b4eb8506d8b05643 to your computer and use it in GitHub Desktop.
Stop Asus ROG Falchion mechanical keyboard from sending POWER and SLEEP key presses when the keyboard goes to sleep. Put in /etc/udev/hwdb.d and then run sudo systemd-hwdb update
evdev:input:b*v0B05p193Ee0111*
KEYBOARD_KEY_10081=reserved
KEYBOARD_KEY_10082=reserved
KEYBOARD_KEY_70070=reserved
KEYBOARD_KEY_70071=reserved
KEYBOARD_KEY_70072=reserved
KEYBOARD_KEY_70073=reserved
KEYBOARD_KEY_70074=reserved
KEYBOARD_KEY_70075=reserved
KEYBOARD_KEY_70076=reserved
KEYBOARD_KEY_70077=reserved
@jnettlet
Copy link
Author

jnettlet commented Oct 5, 2022

Thank you. It does the trick for my Falchion Keyboard in Rocky Linux 9. The 'sudo update.. ' command still kept sleeping my laptop but a reboot took care of that. Question: Have you tried https://github.com/wroberts/rogauracore.git to change the keyboard profile? It doesn't work for me.

I have briefly looked at a few of the ROG projects working on improving Linux support, but really haven't had much time to play around with them. I put this together just to stop my keyboard from doing bad things and running relatively normally without losing any functions.

@Lund1337
Copy link

I have a problem with my rog falchion, it adds random characters.
RThis is an example ofgg how itr trypes. RTestr 12345554.

@jorgecuevass
Copy link

On Manjaro, I had to reboot, but it worked like a charm! Thank You! 🎉

@euclip
Copy link

euclip commented Feb 22, 2023

On Fedora Workstation I also had to reboot. The sudo systemd-hwdb update didn't seem to be enough. After the reboot though, it seems the issue is gone. This is pretty irritating as a matter of principle though and I'm now debating whether to return this keyboard. In any case, thank you for figuring this out!

@rekosuo
Copy link

rekosuo commented Feb 25, 2024

The values after KEYBOARD_KEY_ are scancodes, yes? How did you find out which scancodes needed to be set to reserved? Could you explain what keys lines 2 to 11 act on, and what setting a key to reserved means?

I want to learn how exactly this works.
For normal keys I can find scancodes with evtest, but the keys in the config above don't seem to be normally available on the keyboard.

Also, do you know if this can be done with keycodes instead of scancodes? If it can, how would it be done?

@rekosuo
Copy link

rekosuo commented Feb 26, 2024

I think I found the answer in USB HID Usage Tables 1.5: https://usb.org/sites/default/files/hut1_5.pdf
I think 10081 and 10082 correspond to 81 and 82 (System Power Down and System Sleep) in Generic Desktop Page (0x01).

The ones beginning with 7 correspond to values in Keyboard/Keypad Page (0x07), right?

@jnettlet
Copy link
Author

I think I found the answer in USB HID Usage Tables 1.5: https://usb.org/sites/default/files/hut1_5.pdf I think 10081 and 10082 correspond to 81 and 82 (System Power Down and System Sleep) in Generic Desktop Page (0x01).

The ones beginning with 7 correspond to values in Keyboard/Keypad Page (0x07), right?

Yes that is correct, however I have no idea why they are being sent simultaneous to the expected key codes. It could be a firmware bug, or maybe they trap the keycodes in their software and decided what keycode to pass to the host os depending on software settings. My main objective was just to get the keyboard functional under Linux.

@Jeppo
Copy link

Jeppo commented Mar 31, 2024

Works perfectly on ChimeraOS. Thanks!

@mrdev023
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment