Name
Name

Reputation: 359

How to map a key unless Control is hold down or that key is pressed with Control simultaneously

The following code maps PgUp (resp. PgDn) to WheelUp (resp. WheelDn) unless Control is pressed down. For example If several tabs in firefox are opend and if I first hold down Control then press PgDn I go to the next tab as desired. But If I press Control and PgDn simultaneously I go to the next tab and I have also the effect of WheelDown. How to prevent this WheelDown in this situation?

In other words I would like a mapping Pgdn-->WheelDown if neither Control is hold down nor Pgdn and Control are pressed simultaneously.

#If (NOT (GetKeyState("Control", "P")))
PgUp::WheelUp
PgDn::WheelDown
#If

Upvotes: 1

Views: 282

Answers (1)

Name
Name

Reputation: 359

Finally I found this solution:

~PgDn::while (NOT (GetKeyState("Control", "P")))
Send {WheelDown}

~PgUp::while (NOT (GetKeyState("Control", "P")))
Send {WheelUp}

Upvotes: 1

Related Questions