Numeric Pad's ENTER key ?

How can be this controlled in that simulator? Can HIDmacros be used with this application?
Post Reply
lulu
Posts: 8
Joined: 30 Jun 2016, 21:18

Numeric Pad's ENTER key ?

Post by lulu » 24 Apr 2017, 23:41

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

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

Re: Numeric Pad's ENTER key ?

Post by admin » 25 Apr 2017, 08:06

Are you talking about input side (macro trigger) or output side (some SendKey command)?
Petr Medek
LUAmacros author

lulu
Posts: 8
Joined: 30 Jun 2016, 21:18

Re: Numeric Pad's ENTER key ?

Post by lulu » 25 Apr 2017, 15:22

I hope this clarifies my question :
Image

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

Re: Numeric Pad's ENTER key ?

Post by admin » 26 Apr 2017, 07:56

Somehow can't see the image...
Petr Medek
LUAmacros author

lulu
Posts: 8
Joined: 30 Jun 2016, 21:18

Re: Numeric Pad's ENTER key ?

Post by lulu » 27 Apr 2017, 16:52

That's strange and unfortunate. Here is a download link : https://we.tl/8C3FED1VcZ

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

Re: Numeric Pad's ENTER key ?

Post by admin » 28 Apr 2017, 07:57

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
Petr Medek
LUAmacros author

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

Re: Numeric Pad's ENTER key ?

Post by admin » 12 Jul 2017, 21:43

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)
Petr Medek
LUAmacros author

andr3yionutz
Posts: 1
Joined: 07 Jun 2021, 14:18

Re: Numeric Pad's ENTER key ?

Post by andr3yionutz » 07 Jun 2021, 14:22

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.

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

Re: Numeric Pad's ENTER key ?

Post by admin » 08 Jun 2021, 07:31

The answer is already here above, but you need to know lua to use luamacros.
Petr Medek
LUAmacros author

viktorrios
Posts: 8
Joined: 05 Sep 2021, 04:37

Re: Numeric Pad's ENTER key ?

Post by viktorrios » 26 Sep 2021, 16:06

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

Post Reply