AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Chrome browser Tab control script

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
The.Yield



Joined: 08 Jul 2009
Posts: 9

PostPosted: Fri Jul 31, 2009 6:31 am    Post subject: Chrome browser Tab control script Reply with quote

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! Rolling Eyes

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 Fri Jul 31, 2009 6:03 pm; edited 1 time in total
Back to top
View user's profile Send private message
jethrow



Joined: 24 May 2009
Posts: 722
Location: Iowa, USA

PostPosted: Fri Jul 31, 2009 8:20 am    Post subject: Reply with quote

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

_________________
AHKL, COM_L,Webpage Controls,Donate to AHK
Back to top
View user's profile Send private message
The.Yield



Joined: 08 Jul 2009
Posts: 9

PostPosted: Fri Jul 31, 2009 5:44 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group