Skip to content

Instantly share code, notes, and snippets.

@thedroidgeek

thedroidgeek/msi.ahk

Created Aug 27, 2020
Embed
What would you like to do?
;
; 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