Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
autodelay — spe and slowkeys — time estimation
#4
QM uses quite complex algorithm/equations to calculate key speed. Synchronization, different wait times for different keys, etc. opt slowkeys does not add exactly spe milliseconds after keys.
If you want to precisely control wait times between keys, will need to send each key separately. Can use this function.

Function KeyWithPreciseSpeed
Code:
Copy      Help
;/
function ARRAY(KEYEVENT)'a waitMsAfterKeyDown waitMsAfterKeyUp

;Sends keys, waiting waitMsAfterKeyDown milliseconds after each key down event and waitMsAfterKeyUp milliseconds after each key up event.
;Unlike QM key() function, does not use synchronization, does not depend on spe etc.

;EXAMPLE
;KeyWithPreciseSpeed key("1234567890") 20 80


int i
for i 0 a.len
,KEYEVENT k=a[i]
,if(k.flags=0x80) i+1; continue
,INPUT x.type=INPUT_KEYBOARD
,KEYBDINPUT& r=x.ki
,r.wVk=k.vk; r.wScan=k.sc; r.dwFlags=k.flags
,SendInput 1 &x sizeof(x)
,double wt=iif(k.flags&KEYEVENTF_KEYUP waitMsAfterKeyUp waitMsAfterKeyDown)
,wait wt/1000


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)