Page 1 of 1

Character won't stop immediately w{WAITMS:2000}r

Posted: Thu Jun 17, 2021 1:42 am
by sadiq3210
XMBC Version: v2.19.2
Windows Version: windows 10 64 bit
Mouse Information (brand/model): boblen M5, Made in China
Relevant Computer Information (CPU, RAM etc): Intel, 8
Did the problem occur after an upgrade of XMBC? (If so, from what version?): no
Did the problem occur after a Windows update/upgrade? (If so, from what version?): no
How long have you used XMBC?: recently installed again
What language and keyboard layout do you use in Windows?: english, US

Clear description of the problem - try and include as much information as possible, including what button and mappings you are having problems with (if applicable).: I am trying to walk a character in a game while reloading weapon and keep walking.

here is what i want to do.
Upon mouse wheel up once, it should press W button and keep press it;
after 100 millisecond, it press R button while W is kept pressed;
upon mouse wheel up again, the W key should release and character stop walking immediately.
upon mouse scroll up again the whole sequence should be repeated.

here is what i set:
On layer 1, select mouse wheel up to Simulated keys with custom key "w{WAITMS:2000}r"
and send simulated key stroke as 9 Sticky (held down until button is pressed again)
layer 2 is untouched
in options tab ignore repeated remapped vertical scroll.

the problem is character wont stop immediately. it stops after a delay. Any suggestion or work around? by the way scroll down is unassigned.

Re: Character won't stop immediately w{WAITMS:2000}r

Posted: Thu Jun 17, 2021 9:34 am
by phil
The way XMBC currently works, when it sends the keystrokes (on the first press) it does so in a background thread.
If another keystroke sequence comes in (or in this case, a release key) it adds that the the queue for the background thread to process. The background thread is NOT interrupted or stopped - the wait, and any preceding keys will still be honored. There is no way around this that I can think of without a radical redesign to the way it sends keys, and that's not likely at the current time.

Regards,
Phil

Re: Character won't stop immediately w{WAITMS:2000}r

Posted: Thu Jun 17, 2021 12:27 pm
by sadiq3210
phil wrote: Thu Jun 17, 2021 9:34 am The background thread is NOT interrupted or stopped - the wait, and any preceding keys will still be honored.
Thanks phil for reply.
Is it possible to stop the queue using an independent simulated key, like mouse wheel down to stop the character immediately?

Re: Character won't stop immediately w{WAITMS:2000}r

Posted: Sun Jun 20, 2021 8:10 am
by phil
Any other button or physical key can stop the simulated keystroke - although it probably still plays out the current sequence - I think it just clears the queue so no more queued entries will execute. If one is executing "right now" it wont stop it in its tracks, it cant stop it in its tracks because it has to leave the keyboard in the correct state, that is, if you have presses S and are waiting, you cant stop it completely, you have to release s.

I think I will need to change it to be able to cancel out of the {WAIT} commands, but even then it will still have to complete the sequences (ignoring any waits) to be sure the keyboard is left in the correct state with no stuck keys.