Handle input from keyboard without blocking events

Announcements, questions
Post Reply
Traveller
Posts: 5
Joined: 01 Mar 2021, 18:31

Handle input from keyboard without blocking events

Post by Traveller » 18 Mar 2021, 19:48

I'm still working on this keyboard project, and I had a question/feature request. Is there a way to handle input from a keyboard without blocking it? This is useful when tracking inputs from individual devices without messing up their use/capabilities.
I tried simulating all the keypresses in the handler as a proxy for not blocking them, but I found that this broke the Ctrl + whatever commands. This is actually surprising to me, because when I did that with the 2nd keyboard it didn't block those commands even when I wanted it too, and they have the same driver, so I dunno what's causing it. I don't really want to switch the keyboards because I use a laptop so it's a bit inconvenient.

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

Re: Handle input from keyboard without blocking events

Post by admin » 19 Mar 2021, 08:59

Try to run with -k parameter.
I don't remember exactly - it even does what you need (stop blocking original key) or it doesn't read keyboard completely (so it can't be used as macro trigger)
Petr Medek
LUAmacros author

Traveller
Posts: 5
Joined: 01 Mar 2021, 18:31

Re: Handle input from keyboard without blocking events

Post by Traveller » 19 Mar 2021, 18:10

The -k parameter does indeed do what I need as far as not blocking the keyboards goes!
I have a follow up question though- is there a way to run two instances of LuaMacros simultaneously? I need to block one keyboard without blocking the other, and I'm not quite sure how to do that.

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

Re: Handle input from keyboard without blocking events

Post by admin » 22 Mar 2021, 08:33

No, there's even code in LuaMacros forcing one instance only.
The software uses some dirty hacks to block original key in active application and this is done via global shared memory between active application and luamacros. Having 2 instances would clash with this shared memory even if one of them runs with -k parameter.
Theoretically I could skip this unique instance check when starting with -k, but that would mean changes at more places, some testing and as we talk about quite edge case I don't think I would try to implement it.
Petr Medek
LUAmacros author

Post Reply