Recognizing input - Left Ctrl, Right Ctrl
Recognizing input - Left Ctrl, Right Ctrl
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
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
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
Petr Medek
LUAmacros author
LUAmacros author
Re: Recognizing input - Left Ctrl, Right Ctrl
I've created an issue on GitHub as suggested. Thank you for quick response.
Re: Recognizing input - Left Ctrl, Right Ctrl
Version 0.1.1.98 released with support of this parameter.
With code like
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.
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)
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.
Petr Medek
LUAmacros author
LUAmacros author
Re: Recognizing input - Left Ctrl, Right Ctrl
Everything works - thank you for adding this feature 

Re: Recognizing input - Left Ctrl, Right Ctrl
Could flags also be added to left and right Shift keys, pretty please? 

Re: Recognizing input - Left Ctrl, Right Ctrl
Flags are parameter of callback function, they are not bound to specific key.
Did you try?
Did you try?
Petr Medek
LUAmacros author
LUAmacros author
Re: Recognizing input - Left Ctrl, Right Ctrl
Yes, both Shift keys report Button 16, and flags 0 and 1.
Re: Recognizing input - Left Ctrl, Right Ctrl
I see, will check after Easter
Petr Medek
LUAmacros author
LUAmacros author
Re: Recognizing input - Left Ctrl, Right Ctrl
You are the man, than yiu so much!
I'm using this together with X-Keypad and it's looking great!
I'm using this together with X-Keypad and it's looking great!