Replies: 1 comment
-
|
Hello there. I've found a solution to that. You would need AutoHotKey and Ahk2Exe tools. "C:\Users\MyWindowsUser\Scripts\ChangeLayout.ahk" #Requires AutoHotkey v2.0
#SingleInstance Force
; Windows keyboard layout IDs
; US = 00000409
; Russian = 00000419
hklEN := DllCall("LoadKeyboardLayoutW", "Str", "00000409", "UInt", 0x00000002, "Ptr")
hklRU := DllCall("LoadKeyboardLayoutW", "Str", "00000419", "UInt", 0x00000002, "Ptr")
toggleLayout() {
global hklEN, hklRU
hwnd := WinActive("A")
if !hwnd
return
tid := DllCall("GetWindowThreadProcessId", "Ptr", hwnd, "UInt*", 0, "UInt")
cur := DllCall("GetKeyboardLayout", "UInt", tid, "Ptr")
lang := cur & 0xFFFF
target := (lang = 0x0419) ? hklEN : hklRU
PostMessage 0x50, 0, target,, "ahk_id " hwnd ; WM_INPUTLANGCHANGEREQUEST
}
F12::toggleLayout()"C:\Users\MyWindowsUser\Scripts\WordWithLayout.ahk" #Requires AutoHotkey v2.0
#SingleInstance Force
layoutExe := "C:\Users\MyWindowsUser\Scripts\ChangeLayout.exe"
wordExe := "C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE"
if !ProcessExist("ChangeLayout.exe")
Run('"' layoutExe '"')
cmd := '"' wordExe '"'
for _, arg in A_Args
cmd .= ' "' arg '"'
RunWait(cmd)Convert both of them to .exe file. WIN_EXECUTABLE="C:\\Users\\MyWindowsUser\\Scripts\\WordWithLayout.exe" |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I had just finished installing winapps to work on some assignments in excel, but I am facing keyboard layouts issue. I need to work in both Russian and English, but default shortcuts do not seem to be able to switch between layouts.
The issue only appears when launching the app using winapps, when launched natively in RDP the keyboard layout switching works perfectly fine with the default shift+alt shortcut after installing required language packet in windows settings.
Switching keyboard layout on linux itself doesn't have any effect.
Other discussion posts seems to be focusing on retaining a specific language, but not switching them with the shortcut, but maybe I missed something.
Beta Was this translation helpful? Give feedback.
All reactions