1
votes

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
1
Have you tried it as standalone script? Works for me.user3419297
Yes, I have tried it as standalone script, I have the same problem. To see the problem, please open a firefox with several opened tabs and try to do several `Ctrl+pagedown" to see what I mean. If I hold down Control and do several Pagedown I don't have problem. But when I press both Control and Page down and release both and do the same thing I have the problem.Name
Why not answer your own question, rather than provide it in an edit? It is better form on Stack Overflow to do soRody Oldenhuis
@RodyOldenhuis done.Name
I believe you can also accept it :)Rody Oldenhuis

1 Answers

1
votes

Finally I found this solution:

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

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