Horizontal scrolling shortcut in Windows

Here's an AutoHotKey script to do it using shift and (presumably) native mouse wheel scroll commands:

; Shift + Wheel for horizontal scrolling
+WheelDown::WheelRight
+WheelUp::WheelLeft

This is taken directly from https://gist.github.com/cheeaun/160999.

Keep in mind that a lot of applications, including Microsoft applications, don't support horizontal mouse wheel scrolling. (I believe the feature was only introduced in Windows Vista.)


You could simulate it with AutoHotKey

If I find the script I'll let you know: From these posts:

  • http://www.autohotkey.com/forum/topic5903.html
  • http://www.autohotkey.com/forum/viewtopic.php?t=3640
  • http://www.autohotkey.com/forum/topic27141.html

You should find some scripts

#Persistent mhook := > DllCall("SetWindowsHookEx", "int", 14 > ; WH_MOUSE_LL
    , "uint", RegisterCallback("WheelHorzHook"), > "uint", 0, "uint", 0) return

WheelLeft:
    MsgBox WheelLeft return

WheelRight:
    MsgBox WheelRight return

WheelHorzHook(nCode, wParam, lParam) {
    global mhook
    Critical
    if (wParam = 0x020E)  ; WM_MOUSEHWHEEL (Vista-only)
    {
        if (delta := NumGet(lParam+0,10,"Short"))
        {
            if (delta<0) {
                SetTimer, WheelLeft, -1
                return true
            } else {
                SetTimer, WheelRight, -1
                return true
            }
        }
    }
    return DllCall("CallNextHookEx", "uint", mhook, "int", nCode, "uint",
wParam, "uint", lParam) }

From http://www.autohotkey.com/docs/Hotkeys.htm

Some of the most useful hotkeys for the mouse wheel involve alternate modes of scrolling a window's text. For example, the following pair of hotkeys scrolls horizontally instead of vertically when you turn the wheel while holding down the left Control key:

~LControl & WheelUp::  ; Scroll left.
ControlGetFocus, fcontrol, A
Loop 2  ; <-- Increase this value to scroll faster.
    SendMessage, 0x114, 0, 0, %fcontrol%, A  ; 0x114 is WM_HSCROLL and the 0 after it is SB_LINELEFT.
return

~LControl & WheelDown::  ; Scroll right.
ControlGetFocus, fcontrol, A
Loop 2  ; <-- Increase this value to scroll faster.
    SendMessage, 0x114, 1, 0, %fcontrol%, A  ; 0x114 is WM_HSCROLL and the 1 after it is SB_LINERIGHT.
return