I wish to replace the Numpad1 "1" key stroke by something else, say "A", everywhere.
Problem is: I'm using an extra numeric pad.
I wish only this extra device to have its key "1" replaced.
I've find a way to differentiate it of the main keyboard one.
Using OnMessage(0x00FF, "InputMsg") and the AHKHID library, it works:
- AHKHID_Register(1, 6, hGui, RIDEV_INPUTSINK)
- AHKHID_GetInputInfo(lParam, II_DEVHANDLE)
- AHKHID_GetDevInfo(devh, DI_KBD_NUMBEROFKEYSTOTAL, True) => to differentiate the device
- AHKHID_GetInputInfo(lParam, II_KBD_FLAGS) => filter 0 to take care of the key down only
- AHKHID_GetInputInfo(lParam, II_KBD_VKEY) => gives the key, ex: 97