Page 1 of 1
Numeric Pad's ENTER key ?
Posted: 24 Apr 2017, 23:41
by lulu
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
Re: Numeric Pad's ENTER key ?
Posted: 25 Apr 2017, 08:06
by admin
Are you talking about input side (macro trigger) or output side (some SendKey command)?
Re: Numeric Pad's ENTER key ?
Posted: 25 Apr 2017, 15:22
by lulu
I hope this clarifies my question :
Re: Numeric Pad's ENTER key ?
Posted: 26 Apr 2017, 07:56
by admin
Somehow can't see the image...
Re: Numeric Pad's ENTER key ?
Posted: 27 Apr 2017, 16:52
by lulu
That's strange and unfortunate. Here is a download link :
https://we.tl/8C3FED1VcZ
Re: Numeric Pad's ENTER key ?
Posted: 28 Apr 2017, 07:57
by admin
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
Re: Numeric Pad's ENTER key ?
Posted: 12 Jul 2017, 21:43
by admin
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.
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)
Re: Numeric Pad's ENTER key ?
Posted: 07 Jun 2021, 14:22
by andr3yionutz
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.
Re: Numeric Pad's ENTER key ?
Posted: 08 Jun 2021, 07:31
by admin
The answer is already here above, but you need to know lua to use luamacros.
Re: Numeric Pad's ENTER key ?
Posted: 26 Sep 2021, 16:06
by viktorrios
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