Can you tell me the problem that occurs here and how to solve it.

Announcements, questions
Post Reply
I3ordo
Posts: 16
Joined: 01 Oct 2018, 06:58

Can you tell me the problem that occurs here and how to solve it.

Post by I3ordo » 15 May 2020, 11:58

Hello all,

for months now, my OBS was freezing and nobody was able to pin point the problem as everything was normal on programs end.

Yesterday i found that my code was sending wrong keys sequences sometimes. As if either the ctrl or alt keys are were left down. Can you tell me the problem and how to solve it.

Below is a code that works just as it should.

Code: Select all

--W--^+%
       elseif (button == 87 and direction ==0) then
              lmc_send_keys('%{NUM0}', 50)--unmute Gato
              lmc_sleep(100)
              lmc_send_keys('^{F21}', 50)--start fader
              lmc_sleep(100)
              lmc_send_keys('+{F23}', 50)
              lmc_sleep(300)
              lmc_send_keys('^{F17}', 50)--Mute player
              lmc_sleep(500)
              lmc_send_keys('^{F23}', 50)--start Recording  


and actually it does
but sometimes when i use it after another key assigned to "TAB" key, it sends wrong keys , as if some keys are hold so the next key combinations are mixed into each other , make my streaming software crash.

These are the keys affecting each other, when used one after another.

Code: Select all

--TAB--^+%
          elseif (button == 9 and direction ==0) then
                 lmc_send_keys('^{F19}', 50)   --hide "like"
                 lmc_sleep(100)
                 lmc_send_keys('^{NUM9}', 50)
                 lmc_sleep(300)
                 lmc_send_keys('^{F16}', 50)--unMute player
                 lmc_sleep(100)
                 lmc_send_keys('^{F13}', 50)--mute Gato
                 lmc_sleep(100)
                 lmc_send_keys('^{F24}', 50)--stop Recording


--SHIFT--^+%
          elseif (button == 16 and direction ==0) then
               lmc_send_keys('^{F19}', 50)   --hide "like"
                 lmc_sleep(100)
                 lmc_send_keys('^{F16}', 50)--unMute player
                 lmc_sleep(100)
                 lmc_send_keys('+{INS}', 50)
                 lmc_sleep(300)
                 --lmc_send_keys('^{F13}', 50)--mute Gato
                 lmc_sleep(1000)
                 lmc_send_keys('^{F24}', 50)--stop Recording

--CTRL--^+%
          elseif (button == 17 and direction ==0) then
              lmc_send_keys('^{F19}', 50)   --hide "like"
              lmc_sleep(100)
              lmc_send_keys('^{F16}', 50)--unMute player
              lmc_sleep(100)
              lmc_send_keys('^{NUM7}', 50)
              lmc_sleep(300)
              lmc_send_keys('^{F13}', 50)--mute Gato
              lmc_sleep(100)
              lmc_send_keys('^{F24}', 50)--stop Recording  
I feel as if some alt or ctrl commands are stuck and any new key sends get added to each other

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

Re: Can you tell me the problem that occurs here and how to solve it.

Post by admin » 18 May 2020, 07:28

As your code has delays, aren't you firing another sequence (with some trigger key) when the previous (started by tab) is still running? I would not do that, the lmc_send_keys code is probably not that perfect .
Petr Medek
LUAmacros author

I3ordo
Posts: 16
Joined: 01 Oct 2018, 06:58

Re: Can you tell me the problem that occurs here and how to solve it.

Post by I3ordo » 25 May 2020, 19:14

Thank you!

The issue was very much something like that, i had voicemeeter also looking out for those keys (+f23) so both voicemeeter's macro buttons were also sending sending ctrl+key combinations. Once i removed the triggers from VM, crashes gone.

But there is something else going on here. Sometimes, keys combine into each other and toggle my camera on or off, music player starts and i check the keys, they dont have much longer sequences than 1000ms total each yet some keys behave like stuck, as if ctrl+key combs leave ctrl held or something.

when luamacros send an alt+key combination. sometimes but not always, a shift or ctrl combinations are send as ctrl+alt+key. as if either alt keys are act like being held.

When i record the send keys in ds4windows tool and if i tell it to record also delays. i see this:Image

wait "0ms" that may cause problems?

btw, how else can i send key combinations other than "lmc_sendkeys"?


ps: i tested this and hit , all the sequenced keys , one after another yet , every scene transitioned one after another with proper timings meaning, the keys wait for each other to complete before executing the other.

again thanks for the response

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

Re: Can you tell me the problem that occurs here and how to solve it.

Post by admin » 26 May 2020, 08:22

You can use lmc_send_input. Requires more code but you have full control over presses and releases.
Petr Medek
LUAmacros author

Post Reply