Open akaibukai opened 3 weeks ago
Little update..
When I hit a key (e.g. KEY_WMI_FAN
), I got in reality a bunch of events at once:
InputEvent(EV_MSC, MSC_SCAN, 157
InputEvent(EV_KEY, KEY_UNKNOWN, 1)
InputEvent(EV_SYN, SYN_REPORT, 0)
InputEvent(EV_KEY, KEY_UNKNOWN, 0)
InputEvent(EV_SYN, SYN_REPORT, 0)
FWIW, when I hit a working key in my case (the keys that are on the Fn row like KEY_WMI_CAMERA
) I got the following:
InputEvent(EV_MSC, MSC_SCAN, 133)
InputEvent(EV_KEY, KEY_CAMERA, 1)
InputEvent(EV_SYN, SYN_REPORT, 0)
InputEvent(EV_KEY, KEY_CAMERA, 0)
InputEvent(EV_SYN, SYN_REPORT, 0)
So it seems the KEY_UNKNOWN
part is probably the culprit..
Also for completeness here are the other 2 keys that I wanted to get working:
# KEY_WMI_SWITCHWINDOWS
InputEvent(EV_MSC, MSC_SCAN, 156
InputEvent(EV_KEY, KEY_UNKNOWN, 1)
InputEvent(EV_SYN, SYN_REPORT, 0)
InputEvent(EV_KEY, KEY_UNKNOWN, 0)
InputEvent(EV_SYN, SYN_REPORT, 0)
# KEY_WMI_SCREENPAD
InputEvent(EV_MSC, MSC_SCAN, 106
InputEvent(EV_KEY, KEY_UNKNOWN, 1)
InputEvent(EV_SYN, SYN_REPORT, 0)
InputEvent(EV_KEY, KEY_UNKNOWN, 0)
InputEvent(EV_SYN, SYN_REPORT, 0)
@akaibukai Hi again, code below listen for scan codes 106
, 156
and 157
. The code allows you to send different keys to KEY_UNKNOWN
and change value of your fan thermal policy between 0,1,2
changeable for my previous temporary laptop gu603zi
via file /sys/devices/platform/asus-nb-wmi/throttle_thermal_policy
:
# /usr/share/asus-wmi-hotkeys-driver/keys_wmi_layouts/layout.py
from libevdev import EV_KEY
KEY_WMI_SCREENPAD = 0x6A # 106
KEY_WMI_SWITCHWINDOWS = 0x9C # 156
KEY_WMI_FAN = 0x9D # 157
key_wmi_screenpad = [
KEY_WMI_SCREENPAD, # we listen for scan code 106
EV_KEY.KEY_TOUCHPAD_TOGGLE # and in this case will be sent touchpad toggling evdev key instead of unknown one, choose what you want
]
key_wmi_switchwindows = [
KEY_WMI_SWITCHWINDOWS, # the same as above here, but you can send for example multiple keys together as me <left shift>+<left meta><t>
EV_KEY.KEY_LEFTSHIFT,
EV_KEY.KEY_LEFTMETA,
EV_KEY.KEY_T,
]
KEY_WMI_FAN_THROTTLE_THERNAL_POLICY = '/sys/devices/platform/asus-nb-wmi/throttle_thermal_policy'
KEY_WMI_FAN_THROTTLE_THERNAL_POLICY_VALUES = [
0,
1,
2
]
key_wmi_fan = [
EV_KEY.KEY_PROG4,
[
KEY_WMI_FAN_THROTTLE_THERNAL_POLICY,
KEY_WMI_FAN_THROTTLE_THERNAL_POLICY_VALUES
]
]
keys_wmi = [
key_wmi_screenpad,
key_wmi_switchwindows,
key_wmi_fan
]
What a keys you can use as EV_KEY.xyp
you can find here. For fans at first try manually in the terminal whether works echo "0" | sudo tee /sys/devices/platform/asus-nb-wmi/throttle_thermal_policy
, echo "1" | sudo tee /sys/devices/platform/asus-nb-wmi/throttle_thermal_policy
and echo "2" | sudo tee /sys/devices/platform/asus-nb-wmi/throttle_thermal_policy
.
Hi @ldrahnik!
Just noticed that you're also a maintainer/author here :) Thanks!
So I tried to install this in order to the my keyboard keys I have above my numpad. It seems it correctly installed what's necessary when running
bash install.sh
which I did by selecting theux582z
model..However, at first it was not working.. Looking at the error messages (python) I was able to get that I needed to add the
keys_wmi
that was not present by default in the config file... Basically following theSetup
part of the readme.. Then, using the commands to discover the keycodes/keys value, I noticed the values in the defaultux582z.py
were correct for me. So here is thelayout.py
file I updated:I'm only interested with those 3 keys as the others are already working in my case.
But, unfortunately, it was still not working. I tried to debug a little bit (using good old print statements lol).. And when I hit one of these keys it runs down to this part of the
asus_wmi-hotkeys.py
file (including relevant variables content as comments and skipping unrelevant parts)So it seems that the format of
find_custom_key_mapping
(one dimension list) is not correct and it's not triggering thefor
loops we have on the lines 252, 260 and 268:Can you help me figure out what is wrong in here?
Thanks!