Windows 中的水平滚动快捷方式

Mat*_*ley 76 windows scroll-wheel

在 OS X 中,我可以按住 Shift 键同时使用鼠标上的滚轮水平滚动而不是垂直滚动。有没有办法在 Windows 中做类似的事情?

Sam*_*Sam 26

这是一个 AutoHotKey 脚本,可以使用 shift 和(大概)本机鼠标滚轮滚动命令来执行此操作:

; Shift + Wheel for horizontal scrolling
+WheelDown::WheelRight
+WheelUp::WheelLeft
Run Code Online (Sandbox Code Playgroud)

这直接取自https://gist.github.com/cheeun/160999

请记住,许多应用程序(包括 Microsoft 应用程序)不支持水平鼠标滚轮滚动。(我相信该功能仅在 Windows Vista 中引入。)

  • @cheeesus,对我来说,在 Windows 中,谷歌浏览器实际上内置了对水平滚动的支持。即使没有上面的脚本,我也可以按住 Shift 并滚动鼠标滚轮来水平滚动。 (4认同)
  • 完美的!这是这里最好的答案,简单易行。对于 AutoHotKey 新手,步骤如下: 1) 从 http://www.autohotkey.com/ 下载并安装 AutoHotKey 2) 右键单击​​您的桌面 -> 新建 -> 文本文档 -> 制作一个名为“myscript.ahk” 3) 从上面复制粘贴脚本 -> 保存文件 4) 右键单击​​文件 -> 运行脚本 5) 小 H 图标应该出现在您的任务栏通知区域,现在“Shift +鼠标滚轮”应该产生水平滚动 (2认同)

Ivo*_*pse 18

你可以用AutoHotKey模拟它

如果我找到脚本,我会告诉您:从这些帖子中:

你应该找到一些脚本

#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) }
Run Code Online (Sandbox Code Playgroud)


Mat*_*ock 9

来自http://www.autohotkey.com/docs/Hotkeys.htm

一些最有用的鼠标滚轮热键涉及滚动窗口文本的替代模式。例如,当您在按住左 Control 键的同时转动滚轮时,以下一对热键会水平滚动而不是垂直滚动:

~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
Run Code Online (Sandbox Code Playgroud)


Axx*_*err 6

有一种方法可以在 Windows 中使用鼠标右键执行此操作。我有一个带滚轮的鼠标,它的右侧集成了一个向左/向左轻推按钮。只需向左或向右推动滚轮即可将内容向所需方向移动。我有罗技 VX,我对它非常满意。

如果您愿意,VX 还允许您为每个应用程序配置不同的按钮。这种级别的定制非常好!


Mat*_*ock 5

在某些 Windows 程序中,shift 会水平滚动(例如 Windows 资源管理器)。

在 Internet Explorer、Firefox 和 Excel 等其他程序中,按住滚轮按钮并从左向右移动将水平滚动。

  • Chrome 似乎也有内置的 Shift 水平滚动功能。 (4认同)

Bev*_*lay 5

经过一番环顾,最终找到了一种在 Excel 和其他任何地方都可以使用的方法(使用AutoHotKey),而不会明显破坏任何东西(改编自 AutoHotKey 论坛上的几个不同解决方案,尽管我没有记录来源所以不能给出适当的信用对不起)。

MS Excel 似乎有一些奇怪的方式来处理它的用户界面(尽管不知何故,经过多年看到 MS Office 开发人员给我们的东西,我并不感到惊讶)。除了 MS Word 之外,这个脚本似乎几乎适用于所有地方——如果有人能解决这个问题,请告诉我!这可能类似于找出 Word 的窗口类并专门为它编码,就像使用 Excel 完成的一样(只是使用一组不同的键绑定)。

#Singleinstance Force
#IfWinActive ahk_class XLMAIN
+WheelUp::
SetScrollLockState, On
SendInput {Left}
SetScrollLockState, Off
Return
+WheelDown::
SetScrollLockState, On
SendInput {Right}
SetScrollLockState, Off
Return

; Everything except Excel.
#IfWinNotActive ahk_class XLMAIN
+WheelUp::  ; Scroll left.
ControlGetFocus, fcontrol, A
Loop 4  ; <-- 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

+WheelDown::  ; Scroll right.
ControlGetFocus, fcontrol, A
Loop 4  ; <-- 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
#IfWinActive
Run Code Online (Sandbox Code Playgroud)

  • 我想出了如何在 Word 中做到这一点。`+WheelUp::ComObjActive("Word.application").ActiveWindow.SmallScroll(0,0,0,1) ; +WheelDown::ComObjActive("Word.application").ActiveWindow.SmallScroll(0,0,1,0)` 归功于 [Datapoint](https://www.autohotkey.com/boards/viewtopic.php?p= 207817&amp;sid=24fbb85f440d66810167f8fdc3e1d4f6#p207817)在 AutoHotkey 论坛上。原来 [SmallScroll](https://docs.microsoft.com/en-us/office/vba/api/Word.Window.SmallScroll) 是一个 VBA API。 (2认同)