Page 1 of 2
Recognizing input - Left Ctrl, Right Ctrl
Posted: 01 Mar 2019, 22:56
by MATORAX
I have a problem with recognizing keys on my keyboard in LuaMacros. Both left control and right control appear as one key (identical key number). Same thing goes with left and right alt. Is there a way to recognize these keys as different buttons? I can see in logs that those keys have different "extended" flag. How can I test a button in case of a value in that flag?
Re: Recognizing input - Left Ctrl, Right Ctrl
Posted: 02 Mar 2019, 22:09
by admin
Now you can't.
But I can add the extended flag as 4th parameter of trigger callback.
In near future or feel free to create issue in
https://github.com/me2d13/luamacros/issues for tracking
Re: Recognizing input - Left Ctrl, Right Ctrl
Posted: 03 Mar 2019, 10:10
by MATORAX
I've created an issue on GitHub as suggested. Thank you for quick response.
Re: Recognizing input - Left Ctrl, Right Ctrl
Posted: 04 Mar 2019, 22:00
by admin
Version 0.1.1.98 released with support of this parameter.
With code like
Code: Select all
lmc_assign_keyboard('KBD2')
log_handler = function(button, direction, ts, flags)
print('Callback for device: button ' .. button .. ', direction '..direction..', ts '..ts..', flags '..flags)
end
lmc_set_handler('KBD2', log_handler)
You get for left ctrl (press and release):
Callback for device: button 17, direction 1, ts 8166000, flags 0
Callback for device: button 17, direction 0, ts 8166125, flags 1
And for right ctrl (press and release):
Callback for device: button 17, direction 1, ts 8295125, flags 2
Callback for device: button 17, direction 0, ts 8295203, flags 3
Download link is still
the same.
Re: Recognizing input - Left Ctrl, Right Ctrl
Posted: 05 Mar 2019, 11:11
by MATORAX
Everything works - thank you for adding this feature

Re: Recognizing input - Left Ctrl, Right Ctrl
Posted: 15 Apr 2019, 21:45
by peewee
Could flags also be added to left and right Shift keys, pretty please?

Re: Recognizing input - Left Ctrl, Right Ctrl
Posted: 16 Apr 2019, 08:27
by admin
Flags are parameter of callback function, they are not bound to specific key.
Did you try?
Re: Recognizing input - Left Ctrl, Right Ctrl
Posted: 16 Apr 2019, 09:22
by peewee
Yes, both Shift keys report Button 16, and flags 0 and 1.
Re: Recognizing input - Left Ctrl, Right Ctrl
Posted: 17 Apr 2019, 08:38
by admin
I see, will check after Easter
Re: Recognizing input - Left Ctrl, Right Ctrl
Posted: 17 Apr 2019, 11:41
by peewee
You are the man, than yiu so much!
I'm using this together with X-Keypad and it's looking great!