Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Holding down keys simultaniously
#1
Hello, i was wondering if it was possible to make a macro hold multiple buttons down at one time rather than doing them in quick sequence. So say i wanted to hold "abc" down all at the same time, is there any way to press them all down at the same time, or do they always have to go in sequence?
#2
Macro Macro1553
Code:
Copy      Help
key+ abc
wait 5
key- abc

To press repeatedly, use this function:
Function KeyRepeat
Code:
Copy      Help
;/
function vk ^duration [speed]

;Repeatedly presses a key.

;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. Default 50.

;EXAMPLES
;KeyRepeat VK_SPACE 5 ;;spacebar, 5 seconds
;mac "KeyRepeat" "" VK_SPACE 5 ;;the same, but continue macro immediately
;KeyRepeat 'A' 0.5 1 ;;key A, 0.5 seconds, fastest


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

int t1(GetTickCount) t2

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

spe -1
key- (vk)
#3
Thank you, I'll test this to see if it works for me.

[edit]Thank you very much, i tweaked the code a little bit but i got what i wanted my macro to do, your help is greatly appreciated.


Forum Jump:


Users browsing this thread: 1 Guest(s)