Skip to content

Instantly share code, notes, and snippets.

@honboubao
Created March 4, 2019 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save honboubao/5bc3ff36de6d06efd4cca9f67678f058 to your computer and use it in GitHub Desktop.
Save honboubao/5bc3ff36de6d06efd4cca9f67678f058 to your computer and use it in GitHub Desktop.
AutoHotkey script to map the windows key to the function like a laptop keyboard's Fn key to have Fn+arrow keys act as home, end, page up and page down keys.
;
; Home
;
; Win-Left = Home = start of line
#Left::Send {Home}
; Ctrl-Win-Left = Ctrl-Home = start of document
^#Left::Send {LCtrl down}{Home}{LCtrl up}
; Shift-Win-Left = Shift-Home = select to start of line
+#Left::Send {LShift down}{Home}{LShift up}
; Ctrl-Shift-Win-Left = Ctrl-Shift-Home = select to start of document
^+#Left::Send {LCtrl down}{LShift down}{Home}{LShift up}{LCtrl up}
;
; End
;
; Win-Right = End = end of line
#Right::Send {End}
; Ctrl-Win-Right = Ctrl-End = end of document
^#Right::Send {LCtrl down}{End}{LCtrl up}
; Shift-Win-Right = Shift-End = select to end of line
+#Right::Send {LShift down}{End}{LShift up}
; Ctrl-Shift-Win-Right = Ctrl-Shift-End = select to start of document
^+#Right::Send {LCtrl down}{LShift down}{End}{LShift up}{LCtrl up}
;
; Restore Window Snapping
;
; Alt-Win-Left = Win-Left
!#Left::Send {LWin down}{Left}{LWin up}
; Alt-Win-Right = Win-Right
!#Right::Send {LWin down}{Right}{LWin up}
; Alt-Win-Up = Win-Up
!#Up::Send {LWin down}{Up}{LWin up}
; Alt-Win-Down = Win-Down
!#Down::Send {LWin down}{Down}{LWin up}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment