me2d13 / luamacros

665 stars 87 forks source link

Some keys don't fire up #22

Closed quirinux closed 4 years ago

quirinux commented 6 years ago

Hope this is the best way to ask it:

My keyboard has a key to fire up a calc app and I want to remap it. Its vk code is:

It happens with that specific key code but could affect another ones like that

And get me the following log:

2017-12-14 10:57:04:679 [KBD]: RAW message: message WM_KEYDOWN, key code 183, extended 0, flags 2, makecode 0, direction UP, keyboard handle 0
2017-12-14 10:57:04:690 [HOOK]: Hook message: key code 183 [183], repeat 1, scan code 0, extended 1, alt 0, previous UP, direction DOWN
2017-12-14 10:57:04:690 [HOOK]: Key log match for key 183 direction 1, time diff 11 ms.
2017-12-14 10:57:04:690 [HOOK]: Raw message not yet arrived for key 183 direction 1, trying PeekMessage.
2017-12-14 10:57:04:690 [HOOK]: Key NOT FOUND in key log for key 183 direction 1.
2017-12-14 10:57:04:744 [KBD]: RAW message: message WM_KEYUP, key code 183, extended 0, flags 3, makecode 0, direction DOWN, keyboard handle 0
2017-12-14 10:57:04:753 [HOOK]: Hook message: key code 183 [183], repeat 1, scan code 0, extended 1, alt 0, previous DOWN, direction UP
2017-12-14 10:57:04:753 [HOOK]: Key log match for key 183 direction 0, time diff 9 ms.
2017-12-14 10:57:04:753 [HOOK]: Raw message not yet arrived for key 183 direction 0, trying PeekMessage.
2017-12-14 10:57:04:753 [HOOK]: Key NOT FOUND in key log for key 183 direction 0.

The last line comes from ukeylogservice.pas line 97, AssignDevice function right after calling AssignDeviceInLogRange and trying to pull the key from pile and store on pKS.DeviceHandle

Not sure if it's the expected behavior or if there's an intention to get this kind of keys working

me2d13 commented 6 years ago

What's exactly the issue? You want to use the key as trigger for lua callback and it doesn't work? Or you want to press this key from your lua code? Can you share lua script? BTW better to discuss in forum until we're clear there's fix/improvement needed.

quirinux commented 6 years ago

trigger it to lua callback, openning a thread there though

NotWorreh commented 6 years ago

This problem still exists. For some reason mediakeys like volume down and volume up have no keyboard handle for them so we are unable to use them at all.

me2d13 commented 4 years ago

Yes, those media keys can't be used as triggers and supporting that is not planned (maybe not even possible)