topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 4:54 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Control Click for Chrome  (Read 3412 times)

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Control Click for Chrome
« on: August 30, 2010, 12:14 AM »
It was bugging me that middle clicking a link in Chrome opened in a new tab behind the other tabs.  I found out the standard combination to open in a new foreground tab is Control-Shift-Left Click on the link.  I don't like holding down 2 keys as it's just awkward.  I made this ahk to do the job on middle mouse click.  Thought someone else may find it handy. You can even use it with Speed-dial. The dial you middle click will open in a new tab in foreground instead of replacing the Speed-dial page:

SendMode Input

#IfWinActive, ahk_class Chrome_WidgetWin_0
^LButton::
  Send, ^+{LButton}
Return

edit: since posting it's become evident this interferes with mouse middle click drag to scroll in the browser.  I just changed the hotkey to ^LButton.  At least I don't have to hold down 2 keys while clicking.
« Last Edit: August 30, 2010, 06:47 PM by MilesAhead »

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Control Click for Chrome
« Reply #1 on: September 19, 2010, 06:37 PM »
I combined Control-Click with Transpose, since I always use both functions in Chrome.  Transpose lets you hit Control-t to swap the 2 characters to the left of the caret.  I like that method of fixing typos on the fly. Add class names to the script to add editors/browsers to "EditorGroup" to get Control-t in more apps.

The Control-Click functionality is limited to Chrome. 

#SingleInstance force
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
GroupAdd,EditorGroup, ahk_class TFormEditPadLite  ;EditPadLite
GroupAdd,EditorGroup, ahk_class wxWindowClassNR   ;FBIde
GroupAdd,EditorGroup, ahk_class SciTEWindow       ;Scite
GroupAdd,EditorGroup, ahk_class MAINFBEDIT        ;FBEdit
GroupAdd,EditorGroup, ahk_class Notepad           ;Notepad
GroupAdd,EditorGroup, ahk_class TFormMain         ;TreePad
GroupAdd,EditorGroup, ahk_class Chrome_WidgetWin_0   ;Chrome Browser
GroupAdd,EditorGroup, ahk_class MozillaUIWindowClass ;Firefox Browser

#IfWinActive, ahk_Group EditorGroup
^t::
  ClipSaved := ClipboardAll ; save entire clipboard
  Clipboard= ; clear clipboard
  Send {Shift Down}{Left}{Shift Up} ; select char left of caret
  Send ^c ; copy char
  ClipWait,0 ;give copy time to complete
  ; the caret is positioned to insert
  ; the char from the clipboard. Editor
  ; must be in Insert Mode for it to work.
  ; The char is inserted, and caret positon restored.
  ;
  Send {Right}
  Send {BackSpace}
  Send {Left}
  Send {Raw}%Clipboard% ; avoid puntuaction being interpreted
  Send {Right}
  Clipboard := ClipSaved
  ClipSaved = ; free memory
Return

#IfWinActive, ahk_class Chrome_WidgetWin_0
^LButton::
  Send, ^+{LButton}
Return