I put together a 5x5 macro pad using this pcb http://www.40percent.club/2017/09/25.html so I can easily send things like emojis or emoticons instead of having to google it and then copy/paste it.
It's controlled by a Pro Micro clone and is programmed with the open source firmware QMK.
I programmed each key to be something like this: Control+Alt+Windows+Letter since that combination of modifiers is rarely, if ever, used.
It looks something like this:
Code: Select all
<^<!<#b::Send, B emoji (forum doesn't support it)
<^<!<#c::Send, 100 emoji (forum doesn't support it)
<^<!<#d::Send, (•_•) ( •_•)>⌐■-■ (⌐■_■)
So I would have:
Code: Select all
Key 1:
Layer 0 = Control+Alt+Windows+Letter
Layer 1 = Control+Alt+Windows+Shift+Letter
Layer 2 = Control+Alt+Windows+Number
Layer 3 = Control+Alt+Windows+Shift+Number
Key 2:
Increase current Layer by 1.
Key 3:
Decrease current Layer by 1.
Instead, since QMK unicode support either isn't extensive or easy to use, I would like to use AHK to simulate these layers since I'm already using it to send the emojis and emoticons.
So what I was thinking of doing was to make a variable called Layer assign it with the integer of the current layer. It would be initialized with 0 to start at Layer 0.
If I press <^<!<#a then it will increase the variable by 1. If I press <^<!<#b it will decrease the variable by 1. And then there would be a macro <^<!<#c which performs different functions depending on the layer.
For example:
Code: Select all
Layer = 0; //initialize as starting layer
MaxLayer = 4; //total of 5 layers so max layer is 4
MinLayer = 0; //first layer is 0, can't go below
Loop{
if(<^<!<#a && (Layer+1) <= MaxLayer){ Layer++}; //increment layer by 1 if Layer+1 is less than or equal to max layer
if(<^<!<#b && (Layer-1) >= MinLayer ){Layer--}; //decrement layer by 1 if Layer-1 is less than or equal to min layer
switch(Layer){
case 0:
<^<!<#c:: Send, Layer 0;
case 1:
<^<!<#c:: Send, Layer 1;
case 2:
<^<!<#c:: Send, Layer 2;
case 3:
<^<!<#c:: Send, Layer 3;
case 4:
<^<!<#c:: Send, Layer 4;
}
Any help at all is appreciated, including telling me it can't be done so I don't waste all of my time on it lol.
Thanks!