2 Ways to add layer mod to keyboard.

Post your working scripts, libraries and tools.
lirouxtm
Posts: 3
Joined: 23 Apr 2024, 22:02

2 Ways to add layer mod to keyboard.

24 Apr 2024, 10:19

Code: Select all

;-----------------------------------------------------------------------------------------------
; First way
SC038::altLayer1("Enable/Disable")  ;LAlt
#HotIf altLayer1()
      SC032::1 
      SC033::2
      SC034::3
#HotIf
altLayer1(Param := "") {
    If Param {
        if KeyWait("SC138", "T0.25") {
            ; tap command here
        }
        KeyWait("SC038")
    }
    Else {
        Return GetKeyState("SC038", "P")
    }
} 

;-----------------------------------------------------------------------------------------------
; 2nd Way
SC138::altLayer2("RAlt")  ;RAlt
#HotIf GetKeyState("RAlt", "P")
    SC010::1
    SC011::2
    SC012::3
    SC013::4
    SC014::5
#HotIf

altLayer2(mykey) {
   if KeyWait("SC138", "T0.25") {
            ; tap command here
   }
   KeyWait(mykey)
   return
}

;-----------------------------------------------------------------------------------------------
  
I used left and right alt here.

Return to “Scripts and Functions (v2)”

Who is online

Users browsing this forum: No registered users and 26 guests