AutoHotkey Community

It is currently May 26th, 2012, 9:23 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: July 31st, 2009, 7:31 am 
Offline

Joined: July 8th, 2009, 3:14 pm
Posts: 10
I got a script from a friend that allows you to open and close tabs in Firefox by moving your mouse to the top left of your screen and left or right clicking to open or close tabs. Brilliant stuff, and kudos to whomever made the script originally.

However, I wanted to expand up this functionality to include MouseWheel Scrolling to cycle between tabs (i.e. MouseWheel UP, next tab - MouseWheel DOWN, previous tab)

And also, MouseWheel Click to reopen the most recently closed tab.

Unfortunately this is completely over my head; me looking at this script is like me looking into the Large Hadron Collider - I don't know what anything does and if I were to touch something, I'd probably break it, lol! :roll:

At any rate, for you pro's out there, here's the script (simply modified the app ID to work with Chrome)

Code:
CoordMode Mouse, Screen
 
#IfWinActive ahk_class Chrome_WidgetWin_0
LButton::
MouseGetPos X, Y
If ( X = 0 AND Y = 0)
   Send {ESC}^w
Else
   Send {LButton Down}
Return
 
LButton Up::
If GetKeyState("LButton")
   Send {LButton Up}
Return
 
RButton::
MouseGetPos X, Y
If ( X = 0 AND Y = 0)
   Send {ESC}^t
Else
   Send {RButton Down}
Return
 
RButton Up::
If GetKeyState("RButton")
   Send {RButton Up}
Return


Many, MANY thanks to anyone who can add the aforementioned functionalities to this script.

I will be forever in your dept!

P.S. Here is a link to list of Chrome keyboard shortcuts, as it will likely be very helpful:

http://www.google.com/support/chrome/bin/answer.py?hl=en&answer=95743


Last edited by The.Yield on July 31st, 2009, 7:03 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 31st, 2009, 9:20 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
Quote:
However, I wanted to expand up this functionality to include MouseWheel Scrolling to cycle between tabs ... And also, MouseWheel Click to reopen the most recently closed tab.

Like this?
Code:
WheelUp:: Send, ^{pgup}
WheelDown:: Send, ^{pgdn}
MButton:: Send, ^+t

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 31st, 2009, 6:44 pm 
Offline

Joined: July 8th, 2009, 3:14 pm
Posts: 10
While that does work, it does not work via the condition of being in the top left hand corner... it works all the time, regardless of where my mouse is on the screen.

But then again I did simply add it to the end of the script before the return... Should it go elsewhere in the script?

EDIT: I used 105% of my autohotkey knowledge and attempted to put in what you gave me properly, lol. And it worked!

Here's the result for anyone who wants it:


Code:
CoordMode Mouse, Screen
 
#IfWinActive ahk_class Chrome_WidgetWin_0
LButton::
MouseGetPos X, Y
If ( X = 0 AND Y = 0)
   Send {ESC}^w
Else
   Send {LButton Down}
Return
 
LButton Up::
If GetKeyState("LButton")
   Send {LButton Up}
Return
 
RButton::
MouseGetPos X, Y
If ( X = 0 AND Y = 0)
   Send {ESC}^t
Else
   Send {RButton Down}
Return
 
RButton Up::
If GetKeyState("RButton")
   Send {RButton Up}

WheelUp::
MouseGetPos X, Y
If ( X = 0 AND Y = 0)
   Send ^{pgup}
Else
   Send {WheelUp}
Return

WheelDown::
MouseGetPos X, Y
If ( X = 0 AND Y = 0)
   Send ^{pgdn}
Else
   Send {WheelDown}
Return

MButton::
MouseGetPos X, Y
If ( X = 0 AND Y = 0)
   Send ^+t
Else
   Send {MButton}
Return


P.S. How would one go about adding something like this into a master script?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Google [Bot], wolverineks and 64 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group