Keyboard 1 has id: 2B852B30
and Keyboard 2 has id: 2866AC2B
I assigned Keyboard 1 to be called "Streamdeck"
My issue is that when using "0" on the USB numpad extra keyboard (Streamdeck), I get the registered call and ALSO the Numpad Zero on Keyboard 2.
So I get this sequence:
Code: Select all
streamdeck : \\?\HID#VID_0C45&PID_7663&MI_00#8&2B852B30&0&0000#{884B96C3-56EF-11D1-BC8C-00A0C91405DD} [388695651] : keyboard
<unassigned> : \\?\HID#VID_04D9&PID_1503&MI_00#8&2866AC2B&0&0000#{884B96C3-56EF-11D1-BC8C-00A0C91405DD} [65609] : keyboard
Total number of devices: 2
streamdeck : \\?\HID#VID_0C45&PID_7663&MI_00#8&2B852B30&0&0000#{884B96C3-56EF-11D1-BC8C-00A0C91405DD} [388695651] : keyboard
<unassigned> : \\?\HID#VID_04D9&PID_1503&MI_00#8&2866AC2B&0&0000#{884B96C3-56EF-11D1-BC8C-00A0C91405DD} [65609] : keyboard
Total number of devices: 2
\\?\HID#VID_0C45&PID_7663&MI_00#8&2B852B30&0&0000#{884B96C3-56EF-11D1-BC8C-00A0C91405DD}
Callback for device: button 96, direction 1, flags 18619437
Callback for device: button 96, direction 0, flags 18619593
Callback for device: button 96, direction 1, flags 18620515
Callback for device: button 96, direction 0, flags 18620656
This is the code I am using:
Code: Select all
lmc_device_set_name('streamdeck','2B852B30')
lmc_print_devices()
print(lmc_device_set_name('streamdeck', '2B852B30'))
log_handler = function(button, direction, flags)
print('Callback for device: button ' .. button .. ', direction '..direction..', flags '..flags)
end
lmc_set_handler('streamdeck', log_handler)
lmc_set_handler('streamdeck', function(button,direction)
if (direction == 1) then return end
if (button == 13) then
lmc_send_keys('^{ENTER}', 50)
elseif (button == 97) then
lmc_send_keys('^{NUM1}', 50)
elseif (button == 98) then
lmc_send_keys('^{NUM2}', 50)
elseif (button == 99) then
lmc_send_keys('^{NUM3}', 50)
elseif (button == 100) then
lmc_send_keys('^{NUM4}', 50)
elseif (button == 101) then
lmc_send_keys('^{NUM5}', 50)
elseif (button == 102) then
lmc_send_keys('^{NUM6}', 50)
elseif (button == 103) then
lmc_send_keys('^{NUM7}', 50)
elseif (button == 104) then
lmc_send_keys('^{NUM8}', 50)
elseif (button == 105) then
lmc_send_keys('^{NUM9}', 50)
elseif (button == 111) then
lmc_send_keys('^{NUMDIVIDE}', 50)
elseif (button == 106) then
lmc_send_keys('^{NUMMULTIPLY}', 50)
elseif (button == 109) then
lmc_send_keys('^{NUMMINUS}', 50)
elseif (button == 107) then
lmc_send_keys('^{NUMPLUS}', 50)
elseif (button == 8) then
lmc_send_keys('^{BACKSPACE}', 50)
elseif (button == 110) then
lmc_send_keys('^{NUMDECIMAL}', 50)
elseif (button == 96) then
lmc_send_keys('{left}', 50)
end
end
)
I've also read you can program a second layer of functions when you "turn off" num lock. I was trying to create a script using HID Macros and also to identify they keypress code.
Please help me out.
Thanks.
