39

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?

Joep van Steen
  • 4,730
  • 1
  • 17
  • 34
Handsome Nerd
  • 4,682
  • 17
  • 55
  • 80

8 Answers8

39

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.

iglvzx
  • 23,459
  • 13
  • 85
  • 122
  • Wonderful, works like a charm! Thanks for this. – Per Lundberg Jun 30 '18 at 18:19
  • What about Caps Lock for 1st layout and Shift+CapsLock for 2nd layout, any idea? – mini Mar 16 '19 at 05:55
  • It worked very nice, but sometimes the keyboard-layout switching menu remained open. I found an even better alternative: Use the settings to make the grave (`) key switch layouts, and then use this AutoHotkey script: CapsLock:: Send, {vkC0sc029} SC029:: Send, {Alt down}{Numpad9}{Numpad6}{Alt up} (I used https://www.autohotkey.com/docs/v1/KeyList.htm#SpecialKeys to find the key code of the key. Then, when actually pressing the key, it uses alt-96, which types the character.) – Noam Jun 08 '23 at 09:13
23

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 the 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
Handsome Nerd
  • 4,682
  • 17
  • 55
  • 80
  • http://l.autohotkey.net/ is down :( – turbanoff Aug 31 '15 at 15:10
  • @turbanoff Updated. – Handsome Nerd Sep 01 '15 at 06:57
  • 11
    Second `{Ctrl up}`? Why? – Monah Tuk Dec 15 '16 at 04:26
  • 2
    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. – Muhammad bin Yusrat Jan 10 '19 at 04:41
  • ⊙﹏⊙ I wish I had AHK in ubuntu to easily create my shortcut! – Handsome Nerd Jan 10 '19 at 05:49
  • 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. – coolcat007 Sep 21 '20 at 00:46
  • @PHPst on ubuntu caps lock could be enabled to switch layaout in settings without any scripts. – Dmitriy Aug 10 '21 at 06:09
  • @PHPst Fantastic. Thank You much! – Gennady G Aug 23 '21 at 19:02
  • @GennadyG pleasure – Handsome Nerd Aug 25 '21 at 02:56
  • This hotkey is no longer reliable in Windows 11. It often doesn't switch the language. – Andreyul Dec 21 '22 at 19:31
  • How can I modify this script to run it natively in version 2? Now it asks me to download AHK v1 when I start this script – ruslaniv Jun 11 '23 at 17:46
21

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!

Dave M
  • 13,138
  • 25
  • 36
  • 47
Dimko Desu
  • 311
  • 2
  • 2
  • 3
    Simplest solution. – Vojtěch Dohnal Mar 05 '19 at 15:07
  • 3
    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. – Diego Feb 24 '20 at 02:33
  • This is work great! Thanks so much. – nakorndev Jul 22 '23 at 09:59
7

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.

icem
  • 171
  • 1
  • 2
2

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

1

Use Capslang: simply download suitable exe and put it in folder

%AppData%\Microsoft\Windows\Start Menu\Programs\Startup

(to make it launch automatically when system starts)

Pavel
  • 320
  • 1
  • 3
  • 14
1

I made it using PowerPro tool (as if it is constantly loaded already for other stuff) And now I achieve language change by tapping and CAPSLOCK via long press.

Victor Marchuk
  • 787
  • 2
  • 8
  • 23
0

You can easely (by changing first two lines to:

$~CapsLock::LangSwitch(1)
$~CapsLock up::LangSwitch(2)

) modify wOxxOm's Keyboard layout switcher for using Win+Space instead of right control. And it will work no matter which hotkeys are set up for switching layout in Windows (default is Alt+Shift, I'm using Ctrl+Shift).

Because of non-ahk-native switching (script uses WinAPI), whole script is rather bulky, so I didn't paste it inline. In case of autohotkey.com inaccessibility, here it is: http://pastebin.com/RayAw1VP

(again, all credits go to wOxxOm, source script is there: http://www.autohotkey.com/board/topic/24666-keyboard-layout-switcher/)

P.S. That script is quite old, and has hardcoded byte-offsets, so I'm not sure if it will work with 64-bit Autohotkey.exe or in 64-bit Windows. I only have 32-bit at hand.

P.P.S. This answer is nearly duplicate to another but questions are also nearly similar.

LogicDaemon
  • 1,983
  • 2
  • 20
  • 36