Here is a short AHK script which does two things:
- Creates an extra Shift key on right alt (AltGr)
- Redefines CapsLock as a function key, to be used to type extra characters.
#InputLevel 1 RAlt::RShift ; define shift on right-alt SC03a::F20 ; define special function key on capslock #InputLevel 0 F20 & SC002:: ; the '1' key GetKeyState, sh, Shift if sh = D Send ¡ ; upside-down exclamation else Send ¹ ; superscript 1 return
It nearly works:
- pressing AltGr plus 1 produces '!', as you would expect for a shifted key.
- pressing CapsLock plus 1 produces '¹', as you would expect given the definition above.
The problem arises when you hold down both AltGr and CapsLock and press '1'. This produces '¡' as expected for the first character, but subsequent presses produce '¹'. It appears the Shift state gets magically cancelled after the first press.
Note, this doesn't happen with a "real" Shift key - Caps+Shift+1 produces '¡' every time, so it appears to be a problem with redefining another key to be Shift, where its shift state is cancelled after the first instance.
Am I missing something?
Send ¡{Shift Down}
. It's not very elegant, but should work. - Forivin