Jump to content

If MouseWheel ("up", 1) than send ("{PGUP}")


 Share

Recommended Posts

hi,

how i can do this for 2 actions ?

what i will:

never ending loop

what says:

if Winactive "Session 1 [22x11]" do

if MouseWheel ("up", 1) than send ("{PGUP}")

if MouseWheel ("down", 1) than send ("{PGDN}")

is that possible ?

regards

vision

Link to comment
Share on other sites

hi

thanks for fast answer :

Error: "Wend" statement with no matching "while" statement.

when i start the script

when i add a EndIf in the first if parse the he send permanently pageup, non stop !

and is it not possible to add a winactive title action ?

regards

vision

Edited by Vision
Link to comment
Share on other sites

Sorry I forgot that Window Part. And I forgot to add a EndIF

Func Mouse()
        If MouseWheel("up") Then
        Send("{PgUP}")
    EndIf
    If MouseWheel("down") Then
        Send("{Pgup}")
    EndIf
EndFunc

While 1
    If WinActive("Session 1 [22x11]") Then
    Mouse()
    EndIf
WEnd

Secure

Link to comment
Share on other sites

Description for MouseWheel says "Moves the mouse wheel up or down". Doesn't say anything about

checking, so instead boot up your helpfile and search for "_IsPressed". Should get you on your way.

EDIT : Looks like mousewheel isn't mentioned on that list..oopsie. Well, you could use GUIRegisterMsg

and $WM_MOUSEWHEEL, but I would find it weird if it's not possible to trigger mousewheel using the

IsPressed-method.

Edited by Helge
Link to comment
Share on other sites

it seems thats harder that i think, so anybody can code this ?

with GUIRegisterMsg and $ WM_MOUSEWHEEL ???

I have to run like the wind, but here are some bits and pieces :

Global Const $WM_MOUSEWHEEL = 0x020A
;...
GUIRegisterMsg($WM_MOUSEWHEEL, "MY_WM_MOUSEWHEEL")
;...
Func MY_WM_MOUSEWHEEL($hWnd, $Msg, $wParam, $lParam)
    Local $state = BitShift($wParam, 16) ; -120 is up, 120 is down
EndFunc
Link to comment
Share on other sites

hmm okay i tried this but it not works

Global Const $WM_MOUSEWHEEL = 0x020A

;...

GUIRegisterMsg($WM_MOUSEWHEEL, "MY_WM_MOUSEWHEEL")

;...

Func MY_WM_MOUSEWHEEL($hWnd, $Msg, $wParam, $lParam)

Local $state = BitShift($wParam, 16) ; -120 is up, 120 is down

EndFunc

while 1

If $WM_MOUSEWHEEL = -120 Then

Send("{PgUP}")

EndIf

If $WM_MOUSEWHEEL = 120 Then

Send("{Pgup}")

EndIf

wend

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...