The Computer Oracle

Hotkey to switch input language in Windows 7

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: RPG Blues Looping

--

Chapters
00:00 Hotkey To Switch Input Language In Windows 7
00:24 Accepted Answer Score 3
01:05 Answer 2 Score 3
01:28 Answer 3 Score 1
01:49 Answer 4 Score 0
02:35 Thank you

--

Full question
https://superuser.com/questions/239963/h...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#windows7 #windows #keyboardshortcuts #hotkeys

#avk47



ACCEPTED ANSWER

Score 3


I think Windows doesn't natively support changing these keys. Anyway, you can write an AutoIt script to listen for custom key bindings and programmatically send one of the predefined keyboard shortcuts to the system to change the keyboard layout.

;^ = Ctrl
;! = Alt
;# = WinKey (Meta)
;+ = Shift

HotKeySet("^{Space}", "change") ;Registers Control + Space

;Main loop
While 1
    Sleep(100)
WEnd

;Changes Keyboard Layout
Func change()
    Send ("{ALTDOWN}") ;Hold down Alt
    Sleep(100) ;Wait 100 milliseconds
    Send("{LSHIFT}{ALTUP}") ;Press Left-Shift and release Alt
EndFunc

Just download and install AutoIt (use this link to download and install) and create a file with an .au3 extension. Copy and paste the code above and save it. You can place this file into your Startup folder if you want it to be opened when you login.




ANSWER 2

Score 3


The script above didn't work for me, but I modified it, and now it does.

#Include <Misc.au3>
;~ #RequireAdmin
;^ = Ctrl
;! = Alt
;# = WinKey (Meta)
;+ = Shift

HotKeySet("^{Space}", "change") ;Registers Contorl + Space
$dll = DllOpen("user32.dll")

ToolTip("Try to use ^Space"&@CRLF&"!!!!!!!!!!!!!!!!!!!")
Sleep(3000)
ToolTip('')

;Main loop
While 1
    Sleep(100)
WEnd

;Changes Keyboard Layout
Func change()
 While _IsPressed("11",$dll)
  Sleep(10)
 WEnd
 Send ("{ALTDOWN}") ;Hold down Alt
    Sleep(100) ;Wait 100 milliseconds
    Send("{LSHIFT}{ALTUP}") ;Press Left-Shift and release Alt
EndFunc



ANSWER 3

Score 1


In Windows 7, under Control Panel\Region & Language\Keyboards & Language, select 'Change Keyboards'. You will get a little pop-out window; there chose 'Advanced Key Settings', which allows you to set combinations to directly get each target keyboard, as well as the general switching key sequence.




ANSWER 4

Score 0


Alternative answer

If two keyboard layouts don't differ by many symbols, you could add Alt-modifiers for the foreign language (say, standard US Layout symbols on the Alt layer of a German keyboard) with a utility like AutoHotKey or similar.

Or, create a keymap for the OS which is the more correct way of doing it.

  • never have to switch and wonder which language is active (can be very distracting)
  • you may access the Alt layer often and this slows down your flow.

For some European languages, you could move characters permanently, instead of having a layer.

For example, [] and {} to Alt/Shift combos of () and [];:'" to keys near üäö, allowing you to keep an almost normal US layout for coding and make room for your languages' characters in the spots where they usually reside.