SHARE
TWEET

mintty.ahk

a guest Jul 29th, 2019 149 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; multiple scrolling modifiers in mintty using AutoHotKey
  2.  
  3. ; preamble
  4. ; --------
  5.  
  6. ; install the latest AutoHotKey from here:
  7. ;
  8. ;   https://github.com/Lexikos/AutoHotkey_L/releases
  9.  
  10. ; next, configure mintty to scroll when Ctrl is pressed.  then this
  11. ; script will allow Shift scrolling as well as Shift+Ctrl scrolling.
  12. ; make sure this line is in .minttyrc:
  13. ;
  14. ;   ScrollMod=ctrl
  15.  
  16. ; the easiest way to start this from within Cygwin and immediately
  17. ; return control to bash is probably as follows:
  18. ;
  19. ;   $ explorer.exe mintty.ahk
  20. ;
  21. ; attempts to start autohotkey.exe from either bash or cmd /c did
  22. ; not return control nicely
  23.  
  24. ; script
  25. ; ------
  26.  
  27. ; tell AutoHotKey to reload the script if started again
  28.  
  29. #SingleInstance force
  30.  
  31. ; tell AutoHotKey not to show a tray icon
  32.  
  33. #NoTrayIcon
  34.  
  35. ; test whether the mintty window is active
  36.  
  37. ; note: it's possible to find the ahk_class of a window like this:
  38. ;
  39. ;   WinGetClass, class, A
  40. ;   MsgBox, The active window's class is "%class%".
  41. ;
  42. ; or by using the Window Spy feature from the AutoHotKey tray icon
  43.  
  44. #IfWinActive ahk_class mintty
  45.  
  46. ; map Shift and Shift+Ctrl hotkeys
  47.  
  48. ; + means Shift
  49. ; ^ means Ctrl
  50. ; "a::Send b" catches keypress a and sends b instead
  51. ; {Key} prevents Key from being interpreted as a string
  52.  
  53. +Up::Send ^{Up}
  54. +^Up::Send ^{Up}
  55.  
  56. +Down::Send ^{Down}
  57. +^Down::Send ^{Down}
  58.  
  59. +PgUp::Send ^{PgUp}
  60. +^PgUp::Send ^{PgUp}
  61.  
  62. +PgDn::Send ^{PgDn}
  63. +^PgDn::Send ^{PgDn}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top