winapps icon indicating copy to clipboard operation
winapps copied to clipboard

Add support for switching input method

Open FengZhongShaoNian opened this issue 2 years ago • 22 comments

I'm using the Chinese version of windows 10 , which uses the system's built-in pinyin input method. I use ./bin/winapps manual Notepad.exe to open notepad. I want to input some Chinese in Notepad, but I can't switch to the Chinese input method.

Technical details:

Host OS: Manjaro Linux with KDE plasma 5.27.8 Winapps: Latest git. FreeRDP packages: freerdp 2:2.11.1-1 Arch: amd64. Guest OS: Windows 10 PRO 22H2(Chinese Version).

Input method on Linux: fcitx5-rime Please let me know if you need any more information. If there is some configuration I can do on my end to get this working properly, also please let me know.

Thank you and congratulations for this awesome project!

FengZhongShaoNian avatar Sep 24 '23 05:09 FengZhongShaoNian

Have you tried connecting to the VM normally via RDP and changing the Keyboard layout in windows? Otherwise, maybe you'll find something useful here: https://github.com/FreeRDP/FreeRDP/issues/8980

oskardotglobal avatar Sep 24 '23 09:09 oskardotglobal

Screenshot_20230924_184040

As you can see above, I have two keyboard layouts on my windows, and I tried to remove the English one. Now after opening notepad by ./bin/winapps manual Notepad.exe , I can see the candidate word panel of the Chinese Pinyin input method, but it flashed away during the input process (as shown below), so I still can't enter Chinese normally.

Peek 2023-09-24 18-58

FengZhongShaoNian avatar Sep 24 '23 11:09 FengZhongShaoNian

Is your System layout also Chinese? Maybe thats a problem.

LDprg avatar Oct 06 '23 20:10 LDprg

Do not use any default input method offered by windows. Use 3rd party software like baidu, which includes a feature to trigger the input method by customizing your own shortcut.

ctrngk avatar May 22 '24 07:05 ctrngk

Hello,

I have the exact same problem with the French Keyboard. Since the migration to Docker Windows image, I don't know exactly why but it seems that the US keyboard cannot be removed.... When I start any application, this is always the one selected. I tried so many things to remove this keyboard layout or to ask FreeRDP to use the French Keyboard that I don't know what to do anymore.....

Best, Jerome

jrevillard avatar May 30 '24 06:05 jrevillard

@jrevillard did you change the localisation using docker enviroment flags documented in https://github.com/dockur/windows ?

LDprg avatar May 30 '24 07:05 LDprg

@jrevillard did you change the localisation using docker enviroment flags documented in https://github.com/dockur/windows ?

Yes I did, and actually, I think this is a pur Windows issue so I opened an issue here: https://github.com/dockur/windows/issues/551

Best, Jerome

jrevillard avatar May 30 '24 07:05 jrevillard

@jrevillard I agree with the response from the windows docker repo. It seems like freerdp bug. Maybe you want to report it there and link the issue here?

LDprg avatar May 30 '24 09:05 LDprg

Perhaps this one : https://github.com/FreeRDP/FreeRDP/issues/9678 ?

jrevillard avatar May 30 '24 10:05 jrevillard

@jrevillard can you add /kdb: to your freerdp extra flags in the win apps conf. Or try calling freerdp with the flag manually.

The issue you mentioned seems not to be related.

LDprg avatar May 30 '24 11:05 LDprg

I did already tested xfreerdp3 /kbd:lang:0x040c..., xfreerdp3 /kbd:layout:French,lang:0x040c.... Nothing helped.

jrevillard avatar May 30 '24 11:05 jrevillard

@jrevillard I think you should open a issue on the freerdp repo. This seems to me like a bug in freerdp.

Also are you using x11 or wayland? Wayland causes a lot of strange issues and is not supported.

LDprg avatar May 30 '24 17:05 LDprg

@jrevillard We can include the reg file from dockur/windows#551 in the VM by default if you had good results with that

oskardotglobal avatar May 31 '24 08:05 oskardotglobal

This solved my issue indeed but I don't know if it's a good idea to integrate such specific thing. I guess it could break something for other people...

jrevillard avatar May 31 '24 08:05 jrevillard

Just wanted to add that the registry method mentioned above (adding [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] "IgnoreRemoteKeyboardLayout"=dword:00000001) works - as long as the VM itself has the right keyboard layout in the settings - while the FreeRDP setting (in my case adding RDP_FLAGS="/kbd:0x00000452" to winapps.conf) doesn't as it somehow prevents the Windows app from starting.

This should either be fixed upstream in freerdp or mentioned in the Winapps documentation somewhere.

eylenburg avatar Jun 14 '24 13:06 eylenburg

I've had this problem and solved it by: Running this command to know the hex code for my desired keyboard layout:

xfreerdp /list:kbd

Then opening my configuration file located in ~/.config/winapps/winapps.conf and adding:

RDP_FLAGS="/kbd:layout:0x00000450"

acrilique avatar Sep 15 '24 18:09 acrilique

+1. I have german and ukrainian layouts in windows. And if I open MS Word and try to Win+Space it only changes my language in Linux.

I think there should be some sort of focus for language change or buttons. Or the launcher would work good. #544

ghost avatar Jun 10 '25 17:06 ghost

I'm in the same situation as @KyrTeF. It would be great to be able to change the input method, for example, from the taskbar widget.

hmcezar avatar Aug 27 '25 06:08 hmcezar

@hmcezar you can add /grab-keyboard to your rdp flags in in winapps.conf file. This will allow you to switch input via alt shift

ghost avatar Aug 27 '25 07:08 ghost

@hmcezar you can add /grab-keyboard to your rdp flags in in winapps.conf file. This will allow you to switch input via alt shift

Hmm I added it to the rdp flags, but I'm not sure what you mean by switching via "alt shift". Do you mean literally "ALT + SHIFT"? I tried that and it didn't work. Also tried "WIN + SPACE" but that changes the input in my host system.

hmcezar avatar Aug 27 '25 09:08 hmcezar

Ok, I figured a way out. The problem was that I had two different keyboard layouts for the same language, but Alt + Shift, changes only between languages (by default). You can customize the shortcuts to allow different layouts using the same language.

I'll add a mini tutorial for people trying this in the future:

On Windows you go to Time & Language -> Typing -> Advanced keyboard settings -> Input language hot keys.

There you can configure shortcuts to different languages and keyboard layouts. For example, I set the shortcut Left alt + shift + 1 to one keyboard layout and Left alt + shift + 2 to another layout. Now, everytime I'm using Word, I can just use the shortcut to change to the other layout.

I have /grab-keyboard in my RDP_FLAGS, not sure if this is necessary or not.

hmcezar avatar Aug 27 '25 09:08 hmcezar

I've had this problem and solved it by: Running this command to know the hex code for my desired keyboard layout:

xfreerdp /list:kbd

Then opening my configuration file located in ~/.config/winapps/winapps.conf and adding:

RDP_FLAGS="/kbd:layout:0x00000450"

this one worked for me!

I also did this beforehand: Settings > Time & Language > Typing > Advanced keyboard settings > check the "Use desktop language bar when it's available".

And then, bellow that, go to the "Language bar options" and check "Hidden".

Holzniggl avatar Oct 29 '25 17:10 Holzniggl