Search code examples
autohotkeykeyboard-layout

AutoHotKey: Change keyboard layout by pressing both shift keys


I have used Linux and KDE for a long time and my muscle memory wants to switch keyboard layouts by pressing both shift keys simultaneously. Can I use AutoHotKey to implement that on Windows?

I lack two pieces of information:

  1. How do I remap "both shift keys pressed at the same time"? I can use + to capture the pressing of one shift key, but how about both?

  2. How can I send the key combination that Windows uses to switch layouts (Ctrl+Shift in my current setup)? More generally, how can I remap something to a key combination?


Solution

  • Use combo key notation and L/R prefix, see the documentation (or the help file):

    LShift & RShift::send {LShift down}{LCtrl down}{LShift up}{LCtrl up}