Skip to content

Instantly share code, notes, and snippets.

@thedroidgeek
Created August 27, 2020 16:06
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 thedroidgeek/6dd3d030f75392b54ffca175e49f3f5e to your computer and use it in GitHub Desktop.
Save thedroidgeek/6dd3d030f75392b54ffca175e49f3f5e to your computer and use it in GitHub Desktop.
;
; An autohotkey script for MSI gaming laptops that have swapped Win & Fn keys
; to add macros for the Menu key and media controls
;
; Fn (single press): Meny key (Shift+F10)
; Fn + Ctrl: Play/Pause
; Fn + Ctrl + ⇦: Previous
; Fn + Ctrl + ⇨: Next
;
#SingleInstance Force
#InstallKeybdHook
global fnKeyPressed := false
global fnComboDetected := false
~SC75::
fnKeyPressed := true
return
~SC75 up::
if (A_PriorKey = "^" and !fnComboDetected) {
Send +{F10}
}
fnKeyPressed := false
fnComboDetected := false
return
~VKFF::
if (fnKeyPressed) {
fnComboDetected := true
}
return
RCtrl & Volume_Up::
Send {Media_Next}
return
RCtrl & Volume_Down::
Send {Media_Prev}
return
~SC75 & RCtrl up::
Send {Media_Play_Pause}
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment