Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VERY easy question (Wait, Then Repeat)
#2
Code:
Copy      Help
spe 100
rep
,rig+ 634 222 w1
,rig- 635 241 w1
,lef+ 618 294 w1
,lef- 625 283 w1
,rig+ 682 225 w1
,rig- 681 245 w1
,lef+ 659 299 w1
,lef- 650 297 w1
,rig+ 349 280 w1
,rig- 351 291 w1
,lef+ 333 353 w1
,lef- 335 350 w1
,rig+ 416 266 w1
,rig- 415 266 w1
,lef+ 410 336 w1
,lef- 409 337 w1
,5

If it's a macro then the Pause/Break key in the top right corner of your keyboards should stop it. If not read this:

Code:
Copy      Help
If key is pressed
Syntax
ifk[-] keycode [toggled]
(tab)    statement
(tab)    ...
[else
(tab)    statement
(tab)    ... ]
...



Can be single line:

ifk[-](keycode [toggled]) statement ...
[else statement ...]



Parts
keycode - QM key code. Also can be virtual-key code enclosed in parentheses. Also can test mouse buttons. Virtual-key codes for mouse buttons: 1 left, 2 right, 4 middle.

toggled - if nonzero, check whether key is toggled.

statements - any statements.

Options: - not.



Remarks
Similar to if. If the specified key is pressed, execute statements after ifk and skip statements after else (if any). Otherwise, skip statements after ifk and execute statements after else.



Not all keys and key combinations give correct result. For example, on some operating systems you cannot test the Pause key.



See also: GetMod.



Examples
ifk(F2) bee  if key F2 pressed, beep
ifk(K 1) key K  if key CapsLock toggled, press CapsLock
ifk((1)) bee  if left mouse button pressed, beep

Repeatedly execute some code; stop when key F12 is pressed:
rep
    ...
    ifk(F12) break
Taking on Quick Macros one day at a time


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)