Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Somebody has already asked this
#1
Someone asked this already, but the answer i want is a little different than the answer they wanted, plus, the topic was getting big, so I'm making a new one.

I want Quick Macros to hold the space bar down for 5 seconds.
I've tried
Code:
Copy      Help
key+ V
5
key- V
but it only presses space once.
and I've tried
Code:
Copy      Help
rep
,'V
but it doesn't hold the key down, it just keeps pressing it over and over.
#2
Function KeyRepeat

Code:
Copy      Help
function vk ^duration [speed]

;vk - virtual-key code (see QM Help, virtual-key codes topic)
;duration - number seconds to hold key down
;speed - number of milliseconds between repeated keypresses


;EXAMPLE
;;hold down spacebar for 5 seconds
;KeyRepeat 32 5


;EXAMPLE2
;;the same, but continue macro immediately
;mac "KeyRepeat" "" 32 5



int t1 t2

duration*1000
if(speed<1) speed=50

t1=GetTickCount
spe

rep
,key+ (vk)
,wait speed/1000.0
,if(duration<0) continue
,t2=GetTickCount
,if(t2>t1+duration or t2<t1) break

key- (vk)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Forum Jump:


Users browsing this thread: 1 Guest(s)