Jump to content

Recommended Posts

Posted (edited)

So, using (a modified version of) ezzetabi's _IsPressed function, I created this script that allows me to use "Rocker Navigation" in Internet Explorer.

"Rocker Navigation" is using the two mouse buttons to quickly go back and forth through your history.

Hold left button then rightclick = Forward

Hold right button then leftclick = Back

The only problem I have is that whenever I let go the right button, the context menu pops up. If anyone has any ideas on how to prevent this from happening, I'm all ears.

new code below
Edited by Saunders
Posted

No dice. It just seems to make the browser stop loading right away. I guess I was hoping to some how make it block the sending of the right click to the IE window. Kind of how HotKeySet doesn't let it's key get through to any windows.

  • 2 weeks later...
Posted (edited)

; Code borrowed from _IsPressed function by ezzetabi.

Opt('WinTitleMatchMode', 4)

Global $h_User32Dll = DllOpen("user32")

Func _MDetect($s_Butt)
    Local $s_LButt = '0x01'
    Local $s_RButt = '0x02'
    Local $s_KeyID = Eval('s_' & $s_Butt & 'Butt')

    Local $a_Return = DllCall($h_User32Dll, "int", "GetAsyncKeyState", "int", $s_KeyID)
    If Not @error And BitAnd($a_Return[0], 0x8000) = 0x8000 Then
        Return 1
    Else
        Return 0
    EndIf
EndFunc

Dim $iL, $iR, $iD

While 1
    WinWaitActive('classname=IEFrame', '')
    While WinActive('classname=IEFrame', '')
        If _MDetect('L') And Not $iR Then
            $iL = 1
        ElseIf Not _MDetect('L') Then
            $iL = 0
            $iD = 0
        EndIf

        If _MDetect('R') And Not $iL Then
            $iR = 1
        ElseIf Not _MDetect('R') Then
            $iR = 0
            $iD = 0
        EndIf
            
        If $iL And _MDetect('R') And Not $iD Then
            Send('!{RIGHT}')
            $iD = 1
        ElseIf Not $iD And $iR And _MDetect('L') Then
            Send('!{LEFT}')
            $iD = 1
        EndIf

        Sleep(50)
    WEnd
WEnd

DllClose($h_User32Dll)

Edited by Saunders

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
×
×
  • Create New...