Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; multiple scrolling modifiers in mintty using AutoHotKey
- ; save this text as mintty.ahk
- ; preamble
- ; --------
- ; install the latest AutoHotKey from here:
- ;
- ; https://github.com/Lexikos/AutoHotkey_L/releases
- ; next, configure mintty to scroll when Ctrl is pressed. then this
- ; script will allow Shift scrolling as well as Shift+Ctrl scrolling.
- ; make sure this line is in .minttyrc:
- ;
- ; ScrollMod=ctrl
- ; the easiest way to start this from within Cygwin and immediately
- ; return control to bash is probably as follows:
- ;
- ; $ explorer.exe mintty.ahk
- ;
- ; attempts to start autohotkey.exe from either bash or cmd /c did
- ; not return control nicely
- ; script
- ; ------
- ; tell AutoHotKey to reload the script if started again
- #SingleInstance force
- ; tell AutoHotKey not to show a tray icon
- #NoTrayIcon
- ; test whether the mintty window is active
- ; note: it's possible to find the ahk_class of a window like this:
- ;
- ; WinGetClass, class, A
- ; MsgBox, The active window's class is "%class%".
- ;
- ; or by using the Window Spy feature from the AutoHotKey tray icon
- #IfWinActive ahk_class mintty
- ; map Shift and Shift+Ctrl hotkeys
- ; + means Shift
- ; ^ means Ctrl
- ; "a::Send b" catches keypress a and sends b instead
- ; {Key} prevents Key from being interpreted as a string
- +Up::Send ^{Up}
- +^Up::Send ^{Up}
- +Down::Send ^{Down}
- +^Down::Send ^{Down}
- +PgUp::Send ^{PgUp}
- +^PgUp::Send ^{PgUp}
- +PgDn::Send ^{PgDn}
- +^PgDn::Send ^{PgDn}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement