mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Code
;window -pfdfoC +l @win -1 -1 400 400
on *:keydown:@win:*:{
  echo -sg $ticksqpc $keyrpt
}
When I hold a key, I get:
Quote
767726441 $false
767726941 $true
767726973 $true
767727006 $true
767727039 $true
There is a significant gap between the first and the second time the key are reported by the event. This is not wanted and I don't believe this is intended, when you use this to animate an object from keypress, it results in one movement, then a significant pause, and then it goes normal. Could this be fixed? The second trigger always reports $keyrpt = $true, I'm unsure if it's related, I wouldn't mind getting the event to report a few of keypress with $keyrpt = $false before getting it to be $true.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
Whilst I do understand the underlying requirement, isn't this how keyboards repeats are supposed to work - a longer pause before the first repeat then for subsequent repeats. If you hold a key down in e.g. Microsoft Word, isn't this how the repeat works?

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
That's what I thought at first, but if you go to controlpanel/keyboard - or wherever it is that Win10 hides the setting, there's 2 settings for key board repeats, there's 1 setting for how fast the repeat itself happens, but there's another setting with 4 levels that governs how long is the delay between the 1st letter and the 1st repeat. Even when you change that to the fastest level, it's still a longer pause then between the other letters. Whether the OS won't let this be as short as the other intervals, I dunno.

Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Yes, after a quick discussion on IRC, it's what it seems to be. In fact I was already aware of this behavior in the past, the solution is to handle the movement/keys/input inside an alias called by a timer infinitely. That way you can handle the key press at a regular interval. When writing simple stuff or writing proof of concept, you often end up updating coordinates from the event sadly.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard