Use LuaMacros with scan codes or key codes?

Announcements, general discussion
Post Reply
TSL
Posts: 1
Joined: 17 Mar 2017, 12:12

Use LuaMacros with scan codes or key codes?

Post by TSL » 17 Mar 2017, 12:52

Is it possible to use LuaMacros to intercept keys by scan code or by key code, instead of by the key output? I am looking to do this for a language-independent task, so that the macros are tied to actual keys and do not change when the system language is changed.

Thank you

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

Re: Use LuaMacros with scan codes or key codes?

Post by admin » 20 Mar 2017, 09:54

Interesting idea. In fact we have some issues caused by regional keyboard settings so this would also help.
Anyone else interested? :-)
Petr Medek
LUAmacros author

csadi0011
Posts: 3
Joined: 18 Mar 2017, 11:09

Re: Use LuaMacros with scan codes or key codes?

Post by csadi0011 » 21 Mar 2017, 09:15

So this:
button == 78
instead of this:
button == string.byte('N')

Or I misunderstood?

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

Re: Use LuaMacros with scan codes or key codes?

Post by admin » 22 Mar 2017, 09:08

string.byte does just conversion to number (ascii code).
The change would be specific key will return always the same value (VK key code) with any national keyboard set in Windows.
Petr Medek
LUAmacros author

csadi0011
Posts: 3
Joined: 18 Mar 2017, 11:09

Re: Use LuaMacros with scan codes or key codes?

Post by csadi0011 » 26 Mar 2017, 12:36

That's right.

spdyvkng
Posts: 4
Joined: 27 Mar 2017, 11:38

Re: Use LuaMacros with scan codes or key codes?

Post by spdyvkng » 27 Mar 2017, 12:40

I think using a scan code would be wonderful. There are a lot of software that assumes specific characters (Adobe software) which gets unreachable on national keyboards, or you sit around wondering how do I do this shortcut.

Post Reply