6

I recently started using Firefox as my primary web browser, and I would like to change some of the default keyboard shortcuts, especially the ones used to switch between tabs. Can this be done?

I took a peek through the Firefox directory in "Application Support", as well as the application bundle itself, but nothing jumped out. Google searches have also proved fruitless.

Update: I'm running Firefox version 3.6 for Mac OSX 10.6.2

Doug Harris
  • 28,397

3 Answers3

1

Maybe you can use keyconfig extension for that?

At this link some people say they got it to work on Firefox 3:

@ M.C yes it is !!! (compatible with Firefox 3.6) you have to extract the file "install.rdf" from "functions_for_keyconfig-1.4.0.xpi" with a deziper prog like "WinZip" in Windows or "file roller" in Linux.

Edit "install.rdf" and search for this line: "3.5.". Then replace with "3.6.".

In "functions_for_keyconfig-1.4.0.xpi" replace file "install.rdf" with the modified one. Save. Open your Firefox 3.6, drag and drop the file "functions_for_keyconfig-1.4.0.xpi" in Firefox windows. That's it.

Alfred
  • 571
1

Switch to the Left Tab or Right Tab using keyboard shortcuts:

For Firefox 100+ (more precisely from Firefox Quantum, realeased in 2017, when the keyboard shortcuts remapping add-ons stopped working )

you can switch to the next tab or previous tab using an extension that gives you mouse gestures and use Autohotkey to control the mouse gestures by pressing a key on the keyboard.

For example you can install the add-on: Gesturefy https://addons.mozilla.org/en-US/firefox/addon/gesturefy/ or Foxy Gestures https://addons.mozilla.org/en-US/firefox/addon/foxy-gestures/

and set them up to

  • switch to the right tab when holding the right mouse button and dragging to the right,
  • switch to the left tab when holding the right mouse button and dragging to the left,

Then install Autohotkey and add the following code to the Autohotkey.ahk startup script file:

    ;firefox
#IfWinActive, ahk_exe firefox.exe
;; use key for mouse gesture - Navigate to the Right Tab

f4::

;; use the function - show_Mouse(bShow := True) show_Mouse(False)

;; Click and drag Right - Relative to the current mouse position

;; MouseClickDrag right, start X pos = 0, start Y pos = 0, End X pos = 20 (i.e. to the right), End Y pos 0, Speed = 0 - i.e : in the range: 0 (fastest) to 100 (slowest) , R = relative MouseClickDrag right, 0, 0, 20, 0, 0, R ;; ;; ;; alternative to MouseClickDrag, using SendEvent: ;;SendEvent "{Click 0 0 Down Right Relative}{click 20 0 Up Right Relative}"

;; move back mouse (to the Left) to the original position MouseMove, -20, 0, 0, R

show_Mouse(True)

Return

;; use key for mouse gesture - Navigate to the Left Tab

f3::

;; use the function - show_Mouse(bShow := True) show_Mouse(False)

;; Click and drag Left - Relative to the current mouse position

;; MouseClickDrag right, start X pos = 0, start Y pos = 0, End X pos = -20 (i.e. to the left), End Y pos 0, Speed = 0 - i.e : in the range: 0 (fastest) to 100 (slowest) , R = relative MouseClickDrag right, 0, 0, -20, 0, 0, R ;; ;; ;; alternative to MouseClickDrag, using SendEvent: ;;SendEvent "{Click 0 0 Down Left Relative}{click 20 0 Up Left Relative}"

;; move back mouse (to the Right) to the original position MouseMove, 20, 0, 0, R

show_Mouse(True)

Return

#If ; END for firefox.exe

;; function to hide or show the Mouse pointer

;------------------------------------------------------------------------------- show_Mouse(bShow := True) { ; show/hide the mouse cursor - source: https://www.autohotkey.com/boards/viewtopic.php?f=6&t=37781 ;------------------------------------------------------------------------------- ; WINAPI: SystemParametersInfo, CreateCursor, CopyImage, SetSystemCursor ; https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947.aspx ; https://msdn.microsoft.com/en-us/library/windows/desktop/ms648385.aspx ; https://msdn.microsoft.com/en-us/library/windows/desktop/ms648031.aspx ; https://msdn.microsoft.com/en-us/library/windows/desktop/ms648395.aspx ;--------------------------------------------------------------------------- static BlankCursor static CursorList := "32512, 32513, 32514, 32515, 32516, 32640, 32641" . ",32642, 32643, 32644, 32645, 32646, 32648, 32649, 32650, 32651" local ANDmask, XORmask, CursorHandle

If bShow ; shortcut for showing the mouse cursor

    Return, DllCall("SystemParametersInfo"
        , "UInt", 0x57              ; UINT  uiAction    (SPI_SETCURSORS)
        , "UInt", 0                 ; UINT  uiParam
        , "Ptr",  0                 ; PVOID pvParam
        , "UInt", 0                 ; UINT  fWinIni
        , "Cdecl Int")              ; return BOOL

If Not BlankCursor { ; create BlankCursor only once
    VarSetCapacity(ANDmask, 32 * 4, 0xFF)
    VarSetCapacity(XORmask, 32 * 4, 0x00)

    BlankCursor := DllCall("CreateCursor"
        , "Ptr", 0                  ; HINSTANCE  hInst
        , "Int", 0                  ; int        xHotSpot
        , "Int", 0                  ; int        yHotSpot
        , "Int", 32                 ; int        nWidth
        , "Int", 32                 ; int        nHeight
        , "Ptr", &ANDmask           ; const VOID *pvANDPlane
        , "Ptr", &XORmask           ; const VOID *pvXORPlane
        , "Cdecl Ptr")              ; return HCURSOR
}

; set all system cursors to blank, each needs a new copy
Loop, Parse, CursorList, `,, %A_Space%
{
    CursorHandle := DllCall("CopyImage"
        , "Ptr",  BlankCursor       ; HANDLE hImage
        , "UInt", 2                 ; UINT   uType      (IMAGE_CURSOR)
        , "Int",  0                 ; int    cxDesired
        , "Int",  0                 ; int    cyDesired
        , "UInt", 0                 ; UINT   fuFlags
        , "Cdecl Ptr")              ; return HANDLE

    DllCall("SetSystemCursor"
        , "Ptr",  CursorHandle      ; HCURSOR hcur
        , "UInt", A_Loopfield       ; DWORD   id
        , "Cdecl Int")              ; return BOOL
}

}

The code hides the mouse movement when pressing the keys but you can remove that option (and the show_Mouse() function, too ) and be able to see the mouse moving.

The code means that when you press the F3 key you switch to the Left Tab, and when you press the F4 key you switch to the Right Tab, but the mouse must be inside the page window, not on top of the menu or other buttons, which is easy to do.

Inside Autohotkey, you can use mouse buttons or the scrolling up or down commands instead of keyboard shortcuts.

pclinux
  • 21
0

Tab Mix Plus might be able to do this,
but I haven't tested this myself because installation is complicated.

See the quote and screenshot below -

Tested on Firefox Developer Edition 131.0b4.

Since Firefox removed the internal component that loads legacy extension, in order to install Tab Mix Plus, or any other legacy extension, you have to install 3rd party helper scripts.
Visit xiaoxiaoflood's firefox-scripts repository for more details.

[Tab Mix Plus - edit keyboard shortcuts

xypha
  • 4,890