-
Notifications
You must be signed in to change notification settings - Fork 38
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
How to get DeviceID for a specific button pressed? #6
Comments
So somehow I managed to get handle (?) of device. However I don't know how to filter input based on that handle (?) and how to make it permanent. I guess the numbers will change after reboot. #NoEnv
#SingleInstance force
SendMode Input
SetWorkingDir %A_ScriptDir%
#Include AHKHID.ahk
AHKHID_UseConstants()
;Intercept WM_INPUT
OnMessage(0x00FF, "InputMsg")
AHKHID_AddRegister(1)
AHKHID_AddRegister(1, 6, 0)
AHKHID_Register()
iCount := AHKHID_GetRegisteredDevs(uDev)
msgbox, %iCount%
OnMessage(0x00FF, "InputMsg")
InputMsg(wParam, lParam) {
Local r, h
Critical ;Or otherwise you could get ERROR_INVALID_HANDLE
;Get device type
d_handle := AHKHID_GetInputInfo(lParam, II_DEVHANDLE)
btn_id := AHKHID_GetInputInfo(lParam, II_KBD_VKEY)
} |
And the core problem is that setting |
I have the same problem. I can't obtain which keyboard has send the key. |
Hello, Sir.
I have troubles with understanding the documentation, could you please point me to the right direction?
I have a "laptop" with keyboard and touchpad. Unfortunately, the touchpad is somehow "hacked" by chinese manufacturers, so it has smart gestures emulated. So whenever I swipe left on touchpad, it sends "Left Windows" button.
As far as I see, I can try filtering such buttons by getting DeviceID of keyboard & touchpad and simply ignoring "Left Windows" sends by touchpad.
GetDevInfo function requiers an
index
. However is there any way to get device which send a specific button?The text was updated successfully, but these errors were encountered: