Numeric Pad's ENTER key ?
Numeric Pad's ENTER key ?
Hi Petr,
Is there a way to distinguish within Lua Macros between the ENTER key and the NUMPAD_ENTER key?
My destination software considers the first one to be "RETURN" and the second one "ENTER" which gives me the ability to assign two different behaviors.
But when I hit the corresponding NUMPAD_ENTER key, Lua Macros sends what is detected as "RETURN", not what should be, detected as "ENTER".
Do you know how to address this?
Thanks!
Lulu
Is there a way to distinguish within Lua Macros between the ENTER key and the NUMPAD_ENTER key?
My destination software considers the first one to be "RETURN" and the second one "ENTER" which gives me the ability to assign two different behaviors.
But when I hit the corresponding NUMPAD_ENTER key, Lua Macros sends what is detected as "RETURN", not what should be, detected as "ENTER".
Do you know how to address this?
Thanks!
Lulu
Re: Numeric Pad's ENTER key ?
Are you talking about input side (macro trigger) or output side (some SendKey command)?
Petr Medek
LUAmacros author
LUAmacros author
Re: Numeric Pad's ENTER key ?
That's strange and unfortunate. Here is a download link : https://we.tl/8C3FED1VcZ
Re: Numeric Pad's ENTER key ?
Now I can see picture even in your original post.
So we talk about input side.
If you receive enter key from both keys then no - luamacros can't distinguish now.
Someone was asking here in forum to make macro triggers recognize virtual key codes instead of their representation by keyboard's regional settings. That would probably solve also this issue.
Feel free to create feature request issue here: https://github.com/me2d13/luamacros/issues
So we talk about input side.
If you receive enter key from both keys then no - luamacros can't distinguish now.
Someone was asking here in forum to make macro triggers recognize virtual key codes instead of their representation by keyboard's regional settings. That would probably solve also this issue.
Feel free to create feature request issue here: https://github.com/me2d13/luamacros/issues
Petr Medek
LUAmacros author
LUAmacros author
Re: Numeric Pad's ENTER key ?
Callback function enhanced in LuaMacros version 0.1.1.9 released on July 12th 2017.
Actually the keycode is virtual key code but windows sends value 13 fr both enters. What is different is value of "Flag" attribute and this value can be now passed to callback function (as additional argument). Play with following code - I was able to recognize both enters now.
Actually the keycode is virtual key code but windows sends value 13 fr both enters. What is different is value of "Flag" attribute and this value can be now passed to callback function (as additional argument). Play with following code - I was able to recognize both enters now.
Code: Select all
print(lmc_device_set_name('KBD1', '3970CC3F'))
log_handler = function(button, direction, flags)
print('Callback for device: button ' .. button .. ', direction '..direction..', flags '..flags)
end
lmc_set_handler('KBD1', log_handler)
Petr Medek
LUAmacros author
LUAmacros author
-
- Posts: 1
- Joined: 07 Jun 2021, 14:18
Re: Numeric Pad's ENTER key ?
I am also trying to make it work as a NumPad Enter, as it has different value in Photoshop, but i can't figure it out.
This is what I tried but no result:
elseif (button == 13) then
lmc_send_keys('{ENTER}',50)
Can anyone help me with that?
I am new to this and I don't know to much about Lua.
Thanks in advance.
This is what I tried but no result:
elseif (button == 13) then
lmc_send_keys('{ENTER}',50)
Can anyone help me with that?
I am new to this and I don't know to much about Lua.
Thanks in advance.
Re: Numeric Pad's ENTER key ?
The answer is already here above, but you need to know lua to use luamacros.
Petr Medek
LUAmacros author
LUAmacros author
-
- Posts: 8
- Joined: 05 Sep 2021, 04:37
Re: Numeric Pad's ENTER key ?
Hi @Admin. When I try your above code, the flag always changes:
https://imgur.com/hz7JtjQ
Could you please help us get a function out of the flag like you mentioned in your previous post (as a callback?)
Could you share the actual code to do this, please? I know my device ID to identify the secondary usb Numpad keyboard
but that's as far as I could get.
Thanks
https://imgur.com/hz7JtjQ
Could you please help us get a function out of the flag like you mentioned in your previous post (as a callback?)
Could you share the actual code to do this, please? I know my device ID to identify the secondary usb Numpad keyboard
but that's as far as I could get.
Thanks