Jump to content
Sign in to follow this  
Vision

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

Recommended Posts

Vision

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

Share this post


Link to post
Share on other sites
Vision

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

Share this post


Link to post
Share on other sites
James

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

Share this post


Link to post
Share on other sites
Vision

hmm thanks but when i stat this script its press permanently Page up /page down

without to hit the mouse wheel...

regards vision

Share this post


Link to post
Share on other sites
Helge

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

Share this post


Link to post
Share on other sites
Vision

ohw i see it now too ^^

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

with GUIRegisterMsg and $ WM_MOUSEWHEEL ???

regards

vision

Share this post


Link to post
Share on other sites
Helge

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

Share this post


Link to post
Share on other sites
Vision

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

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.