In Os X, I can hold Shift while using the scroll wheel on the mouse to scroll horizontally instead of vertically. Is there a way to do something similar in Linux?
Linux – Horizontal scrolling shortcut in Linux
linuxscroll-wheel
Related Solutions
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) }
How to horizontally scroll in Notepad++?
You can scroll horizontally in Notepad++ the same way(s) you scroll horizontally in any other program. A convenient way
I know the way by dragging horizontal scroll bar, but I would like more convenient way.
It depends on what you consider convenient, but there are a few options.
Scrolling with keyboard
You can usually use the Left and Right keys in combination with some modifiers in most programs. For example, Ctrl+Left/Right usually scrolls all the way or one interval. Also, PageUp and PageDown can usually be combined with Ctrl to scroll one interval horizontally instead of vertically. The same goes for Home and End (which typically scroll to the beginning or end of a line).
In the case of Notepad++ specifically, it doesn’t seem to support any of these by keyboard or via mouse. Unfortunately, even the Shortcut Mapper doesn’t seem to have any horizontal-scrolling items that can be mapped to a hotkey. You could look for a plugin, but there is an easier way:
Universal Solution
Scrolling with mouse wheel while holding Shift key pressed.
Some programs support this intrinsically and some mouse drivers/software supports it, but you easily set it up manually with AutoHotkey.
The AutoHotkey documentation already has a convenient script that lets you scroll horizontally by holding a modifier key and turning the mouse-wheel (reproduced here with Shift
instead of LControl
):
~Shift & WheelUp:: ; Scroll left
ControlGetFocus, fcontrol, A
Loop 2 ; <-- Increase this value to scroll faster.
SendMessage, 0x114, 0, 0, %fcontrol%, A ; 0x114=WM_HSCROLL; 0=SB_LINELEFT
return
~Shift & WheelDown:: ; Scroll right
ControlGetFocus, fcontrol, A
Loop 2 ; <-- Increase this value to scroll faster.
SendMessage, 0x114, 1, 0, %fcontrol%, A ; 0x114=WM_HSCROLL; 1=SB_LINERIGHT
return
You can customize and extend the script as needed; for example, you can add keyboard hotkeys, modify the scroll amount, etc.
I have lots of long lines in logs files. And I need to scroll very fast both ways: horizontally and vertically.
You can create multiple hotkeys as above to scroll a little, a medium amount, or a lot to suit your needs. You can even compile your script and run it as a background program.
Best Answer
For a lot of things like this, xmodmap is useful, but I don't think it can remap keyboard+mouse combinations. However, you might have some luck using imwheel. It's actually fairly powerful - you can customize to have different mappings in different windows! For example, here's the first section of the sample file included in the source tarball:
This will apply to mutt (or rather, windows with titles matching that pattern). The first field is keyboard modifiers for the input event, the second is mouse button/wheel input event, and the third column is output events. So, the first one maps wheel up to keyboard up, and the third maps left control+wheel up to page up.