Page 1 of 1

Keys not being blocked?

Posted: 13 Feb 2018, 02:45
by wolfmitchell
With this simple script, whenever I press a key on the attached numpad, it shows on the log on LuaMacros, but the key press is still sent to the application. How would I fix this?

Code: Select all

clear()
lmc_device_set_name("numpad", "8343707")
lmc_set_handler('numpad', function(btn, dir)
    print(btn, dir)
end)

Re: Keys not being blocked?

Posted: 13 Feb 2018, 09:01
by admin
Your script is fine, so stopping the key doesn't work for some reason.
Is it "regular" windows application like notepad? Or some game?

Re: Keys not being blocked?

Posted: 13 Feb 2018, 13:54
by wolfmitchell
The key isn't being blocked in Vivaldi (web browser based on Chrome), LuaMacros itself, Notepad, HexChat (IRC client), and Discord (chat client).

Re: Keys not being blocked?

Posted: 22 Feb 2018, 20:43
by wolfmitchell
I'm guessing there isn't anything I can do to fix it?

Re: Keys not being blocked?

Posted: 23 Feb 2018, 19:28
by admin
Hard to say, there's something specific in your system.
You can run the case with full logging and check the log for some strange message...

Re: Keys not being blocked?

Posted: 02 Mar 2019, 09:27
by n0xew
Hi,

I encounter the same issue with the following script - key events are not blocked in multiple programs, especially Windows' start menu.
The script in use:

Code: Select all

clear()
lmc_log_all();
lmc_log_spool('this_will_be_long.log')

lmc_device_set_name('Remote', '10BCEBFB');

lmc_set_handler('Remote',string.byte('Z'),0,function(button, direction)
  lmc_send_input(string.byte('Y'), 0, 0) -- press Y
  lmc_send_input(string.byte('Y'), 0, 2) -- release Y
end)
And the corresponding log:

Code: Select all

2019-03-02 09:25:47:389 [HOOK]: Hook message: key code 46 [46], repeat 1, scan code 83, extended 1, alt 0, previous DOWN, direction UP
2019-03-02 09:25:47:390 [HOOK]: Raw message not yet arrived for key 46 direction 0, trying PeekMessage.
2019-03-02 09:25:47:390 [KBD]: RAW message: message WM_KEYUP, key code 46, extended 0, flags 3, makecode 83, direction DOWN, keyboard handle 65603
2019-03-02 09:25:47:391 [HOOK]: PeekMessage got 1 messages.
2019-03-02 09:25:47:391 [HOOK]: Key log match for key 46 direction 0, time diff 0 ms.
2019-03-02 09:25:51:220 [KBD]: Found keyboard \\?\HID#VID_046D&PID_C232#2&20CF3930&0&0000#{884B96C3-56EF-11D1-BC8C-00A0C91405DD} handle 2295637.
2019-03-02 09:25:51:220 [KBD]: Found keyboard \\?\HID#VID_2319&PID_00B2&MI_03#7&10BCEBFB&0&0000#{884B96C3-56EF-11D1-BC8C-00A0C91405DD} handle 65607.
2019-03-02 09:25:51:221 [KBD]: Found keyboard \\?\HID#VID_046D&PID_C07E&MI_01&COL01#7&14C93907&0&0000#{884B96C3-56EF-11D1-BC8C-00A0C91405DD} handle 65605.
2019-03-02 09:25:51:221 [KBD]: Found keyboard \\?\HID#VID_1E7D&PID_3264&MI_00#7&3891A56&0&0000#{884B96C3-56EF-11D1-BC8C-00A0C91405DD} handle 65603.
2019-03-02 09:25:51:221 [LUA]: Added handler 3 for device Remote, key 90, direction 0
2019-03-02 09:25:51:222 [LUA]: Lua worker: finished simple code, length 302, execution time: 1 ms
2019-03-02 09:25:51:222 [LUA]: Lua worker: queue size is 0, suspending thread...
2019-03-02 09:25:51:222 [CFG]: Getting boolean MINIMIZETOTRAY
2019-03-02 09:25:51:223 [CFG]: Getting boolean AUTORELOAD
2019-03-02 09:25:51:223 [CFG]: Getting boolean STATISTICS
2019-03-02 09:25:51:223 [CFG]: Getting boolean MINIMIZETOTRAY
2019-03-02 09:25:51:224 [CFG]: Getting boolean AUTORELOAD
2019-03-02 09:25:51:224 [CFG]: Getting boolean STATISTICS
2019-03-02 09:25:57:147 [KBD]: RAW message: message WM_KEYDOWN, key code 90, extended 0, flags 0, makecode 21, direction UP, keyboard handle 65607
2019-03-02 09:25:57:398 [KBD]: RAW message: message WM_KEYUP, key code 90, extended 0, flags 1, makecode 21, direction DOWN, keyboard handle 65607
2019-03-02 09:25:57:398 [LUA]: Calling handler 3 for device Remote, key 90, direction 0, ts 2891093
2019-03-02 09:25:57:399 [LUA]: Item callback id 3, int params 90, 0, 2891093 added to queue making it 1 items big.
2019-03-02 09:25:57:399 [LUA]: Lua worker: resumed...
2019-03-02 09:25:57:399 [LUA]: Lua worker: starting procedure callback id 3, int params 90, 0, 2891093, queue size is 1
2019-03-02 09:25:57:400 [CFG]: Getting boolean AUTORELOAD
2019-03-02 09:25:57:400 [KBD]: Sending input vk:89, scan:0, flags:0
2019-03-02 09:25:57:400 [CFG]: Getting boolean STATISTICS
2019-03-02 09:25:57:401 [KBD]: Sending input vk:89, scan:0, flags:2
2019-03-02 09:25:57:401 [CFG]: Getting boolean AUTORELOAD
2019-03-02 09:25:57:401 [LUA]: Lua worker: finished callback id 3, int params 90, 0, 2891093, execution time: 1 ms
2019-03-02 09:25:57:402 [CFG]: Getting boolean STATISTICS
2019-03-02 09:25:57:402 [LUA]: Lua worker: queue size is 0, suspending thread...
2019-03-02 09:25:57:403 [CFG]: Getting boolean MINIMIZETOTRAY
2019-03-02 09:25:57:403 [CFG]: Getting boolean AUTORELOAD
2019-03-02 09:25:57:403 [CFG]: Getting boolean STATISTICS
2019-03-02 09:25:57:404 [CFG]: Getting boolean MINIMIZETOTRAY
2019-03-02 09:25:57:404 [CFG]: Getting boolean AUTORELOAD
2019-03-02 09:25:57:405 [CFG]: Getting boolean STATISTICS
2019-03-02 09:25:57:405 [KBD]: RAW message: message WM_KEYDOWN, key code 89, extended 0, flags 0, makecode 0, direction UP, keyboard handle 0
2019-03-02 09:25:57:405 [KBD]: RAW message: message WM_KEYUP, key code 89, extended 0, flags 1, makecode 0, direction DOWN, keyboard handle 0
2019-03-02 09:25:57:960 [KBD]: RAW message: message WM_KEYDOWN, key code 90, extended 0, flags 0, makecode 21, direction UP, keyboard handle 65607
2019-03-02 09:25:58:149 [KBD]: RAW message: message WM_KEYUP, key code 90, extended 0, flags 1, makecode 21, direction DOWN, keyboard handle 65607
2019-03-02 09:25:58:149 [LUA]: Calling handler 3 for device Remote, key 90, direction 0, ts 2891843
2019-03-02 09:25:58:150 [LUA]: Item callback id 3, int params 90, 0, 2891843 added to queue making it 1 items big.
2019-03-02 09:25:58:150 [LUA]: Lua worker: resumed...
2019-03-02 09:25:58:151 [LUA]: Lua worker: starting procedure callback id 3, int params 90, 0, 2891843, queue size is 1
2019-03-02 09:25:58:151 [KBD]: Sending input vk:89, scan:0, flags:0
2019-03-02 09:25:58:151 [CFG]: Getting boolean AUTORELOAD
2019-03-02 09:25:58:152 [CFG]: Getting boolean STATISTICS
2019-03-02 09:25:58:152 [KBD]: Sending input vk:89, scan:0, flags:2
2019-03-02 09:25:58:152 [CFG]: Getting boolean AUTORELOAD
2019-03-02 09:25:58:153 [CFG]: Getting boolean STATISTICS
2019-03-02 09:25:58:153 [KBD]: RAW message: message WM_KEYDOWN, key code 89, extended 0, flags 0, makecode 0, direction UP, keyboard handle 0
2019-03-02 09:25:58:155 [LUA]: Lua worker: finished callback id 3, int params 90, 0, 2891843, execution time: 4 ms
2019-03-02 09:25:58:156 [LUA]: Lua worker: queue size is 0, suspending thread...
2019-03-02 09:25:58:156 [CFG]: Getting boolean MINIMIZETOTRAY
2019-03-02 09:25:58:156 [CFG]: Getting boolean AUTORELOAD
2019-03-02 09:25:58:157 [CFG]: Getting boolean STATISTICS
2019-03-02 09:25:58:157 [CFG]: Getting boolean MINIMIZETOTRAY
2019-03-02 09:25:58:157 [CFG]: Getting boolean AUTORELOAD
2019-03-02 09:25:58:157 [CFG]: Getting boolean STATISTICS
2019-03-02 09:25:58:158 [KBD]: RAW message: message WM_KEYUP, key code 89, extended 0, flags 1, makecode 0, direction DOWN, keyboard handle 0
2019-03-02 09:26:02:440 [SPE]: Speech worker: resumed...
2019-03-02 09:26:02:443 [LUA]: Lua worker: resumed...
Thanks for your help if you find a solution, and thanks for this amazing tool!

Re: Keys not being blocked?

Posted: 06 Apr 2019, 23:40
by Etuldan
Got the same issue, but only for some specific software :
StartMenu, Discord (only for Push To Talk), some game

I have no issue with more 'regular' software like Firefox, Notepad++, Discord Text chat

Re: Keys not being blocked?

Posted: 21 Jun 2019, 19:06
by chio987
any ideas on this? i have the same issue with SAP and i thought it was only with that program but it also happens in word and excel. on a keyboard tester it only activates the macro and not the hotkey used to activate it.

this is all mine is right now until i can fix this issue

Code: Select all

lmc_device_set_name('SAP','20D7E92')
lmc_print_devices()

lmc_set_handler('SAP', function(button,direction)
  if (direction == 1) then return end
  if (button == 97) then
    lmc_send_keys('XRWP{DOWN 1}', 50)

    elseif (button == 98) then
    lmc_send_keys('+{F5}', 50)

    elseif (button == 99) then
    lmc_send_keys('^c', 50)


  end
end
)