Recognizing input - Left Ctrl, Right Ctrl

Announcements, questions
admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: Recognizing input - Left Ctrl, Right Ctrl

Post by admin » 17 Apr 2019, 19:15

Ok, had some time even before Easter :-)
I realized that left/right control send different flags, but left/right shift sends different MakeCode
So I tried to build new exe which sends even fifth parameter to callback method.
Download this beta build from here and try code:

Code: Select all

clear();
lmc_assign_keyboard('KBD2')

log_handler = function(button, direction, ts, flags, makecode)
  print('Callback for device: button ' .. button .. ', direction '..direction..', ts '..ts..', flags '..flags..', makecode '..makecode)
end

lmc_set_handler('KBD2', log_handler)
Then for left/right shift you should get something like

Code: Select all

Callback for device: button 16, direction 1, ts 1887796, flags 0, makecode 42
Callback for device: button 16, direction 0, ts 1887968, flags 1, makecode 42
Callback for device: button 16, direction 1, ts 1889046, flags 0, makecode 54
Callback for device: button 16, direction 0, ts 1889156, flags 1, makecode 54
Please try and if it helps, I make it official in next version
Petr Medek
LUAmacros author

peewee
Posts: 10
Joined: 30 Mar 2019, 13:43

Re: Recognizing input - Left Ctrl, Right Ctrl

Post by peewee » 23 Apr 2019, 13:44

Hello, and sorry for the late reply!

MakeCode works perfect! THANK YOU SO MUCH!!!

Post Reply