Using CapsLock to switch the keyboard language layout on Windows-7

33,987

Solution 1

In windows you can set Windows to use Grave Accent (`) for switching between languages or keyboard layouts via a single key press.

If your windows is set to change keyboard layout by Ctrl+Shift you can use following AutoHotKey script (I strongly recommend using http://www.autohotkey.com/) to map them to Caps Lock, normal CapsLock will be achieved by Shif+CapsLock

SetCapsLockState, AlwaysOff
+CapsLock::CapsLock

CapsLock::Send, {Ctrl down}{Shift down}{Shift up}{Ctrl up}{Ctrl up}
return

Solution 2

Following @Bob's suggestion to use AutoHotkey, the following script will simulate Alt+Shift when you press CapsLock:

CapsLock::Send, {Alt Down}{Shift Down}{Shift Up}{Alt Up}

Windows can be a little stubborn when it comes to keyboard shortcuts only consisting of modifiers, but the above technique works.

Solution 3

Use lswitch.

Use any key to switch input languages, usage: lswitch [keycode]. Keycode is optional and defaults to context menu key. Another good candidate is a CapsLock key with a keycode of 20.

Cheers!

Solution 4

Punto Switcher can do this! http://punto.yandex.ru/win/

Basically it allows you to switch keyboard layout automatically, based on what you are typing. But it also can switch keyboard layouts on Caps Lock or many other keys. If don't like automatic switching you can turn it off in settings.

Solution 5

Around a year ago I switched from ReCaps to keyla and I am pretty much happy with it.

Share:
33,987
Handsome Nerd
Author by

Handsome Nerd

A good Persian dictionary for you: [Vajje.com]: http://vajje.com Stack Exchange Q&A site proposal: Mnemonics http://area51.stackexchange.com/ads/proposal/75542.png

Updated on September 18, 2022

Comments

  • Handsome Nerd
    Handsome Nerd over 1 year

    Currently I am using Recaps for switching between keyboard layouts. But I am looking for a replacement, because it is a little buggy and not updated for years. Do you know any replacement?

    • Ignacio Vazquez-Abrams
      Ignacio Vazquez-Abrams about 12 years
      Any particular OS, or will you accept an answer for Haiku?
    • Paul
      Paul about 12 years
      Recaps is a Windows app, so it is either that or Plan 9
    • tvdo
      tvdo about 12 years
      Is it alright for Alt + Shift to still be assigned to language switching? If so, AutoHotkey could be used to send an Alt + Shift on CapsLock.
    • iglvzx
      iglvzx almost 12 years
      @Reza Your AHK code is wrong. + is the Shift modifier, it must come before {Raw} or normal keys. Try: Send, +{LAlt}
    • Handsome Nerd
      Handsome Nerd almost 12 years
      @iglvzx It did not work.
    • tvdo
      tvdo almost 12 years
      What do you mean by not so stable yet?
    • Handsome Nerd
      Handsome Nerd almost 12 years
      @Bob It stop working in win 7 suddenly, also you have set language each time you restart windows
  • Handsome Nerd
    Handsome Nerd over 11 years
    Dose it have an English version?
  • icem
    icem over 11 years
    Sorry, it seems that it's Russian only. Probably because it's main function is keyboard layout auto-switch (rus-en). Anyway, my answer can help Russian users.
  • turbanoff
    turbanoff over 8 years
    l.autohotkey.net is down :(
  • Handsome Nerd
    Handsome Nerd over 8 years
    @turbanoff Updated.
  • Paul Annekov
    Paul Annekov about 8 years
    Skype 7.23 hangs when switching language via Caps Lock in Windows 10.
  • Monah Tuk
    Monah Tuk over 7 years
    Second {Ctrl up}? Why?
  • Monah Tuk
    Monah Tuk over 7 years
    Keyla site is die.
  • kyb
    kyb over 6 years
    too much functional for this task in this app.
  • Per Lundberg
    Per Lundberg almost 6 years
    Wonderful, works like a charm! Thanks for this.
  • Muhammad bin Yusrat
    Muhammad bin Yusrat over 5 years
    I was forced to use windows at work after a long time, and can't even imagine how easy things were in Ubuntu and how difficult these things are here on Windows. For things as trivial as a keyboard shortcut you have to install an separate program.
  • Handsome Nerd
    Handsome Nerd over 5 years
    ⊙﹏⊙ I wish I had AHK in ubuntu to easily create my shortcut!
  • Vojtěch Dohnal
    Vojtěch Dohnal about 5 years
    Simplest solution.
  • mini
    mini about 5 years
    What about Caps Lock for 1st layout and Shift+CapsLock for 2nd layout, any idea?
  • Diego
    Diego over 4 years
    This works for English, German and/or Russian keyboard layouts or input languages as well. The only thing that reliably worked for me for decades already in any Windows version. Add a shortcut it to C:\Users\user\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup with target "lswitch.exe 20" (no quotes) to run all the time. Grave Accent doesn't work for e.g. German layout.
  • coolcat007
    coolcat007 over 3 years
    A little off topic, but in Windows you don't always need to install a program for keyboard shortcuts. To start programs, you can add keyboard shortcuts to the desktop shortcuts, from their properties. Also, AHK is just a nice tool to programmatically create macros, including, but not limited to creating keyboard shortcuts. Also, with linux you have the benefit of choosing a distro that has all the features that you want preinstalled. Windows is a one size fits all and im glad that they don't add ALL the bloat that some people might not need.
  • Weirdei
    Weirdei over 3 years
    Still smaller then AHK though
  • Dmitriy
    Dmitriy almost 3 years
    @PHPst on ubuntu caps lock could be enabled to switch layaout in settings without any scripts.
  • Gennady G
    Gennady G almost 3 years
    @PHPst Fantastic. Thank You much!
  • Handsome Nerd
    Handsome Nerd almost 3 years
    @GennadyG pleasure