symless / synergy-core

Open source core of Synergy, the cross-platform keyboard and mouse sharing tool (Windows, macOS, Linux)
https://symless.com/synergy
Other
10.13k stars 3.6k forks source link

International keyboard support #5

Closed nbolton closed 9 years ago

nbolton commented 9 years ago

Imported issue:

h2. Version 2 requirement

Version 2 must have full international keyboard support; non-us keyboard input in version 1 was unreliable. We may be able to enforce this with unit/integration tests.


h2. Original bug report

What steps will reproduce the problem?

  1. Switch to non-US layout (e.g. RU)
  2. Type a word

What is the expected output? What do you see instead?
layout gets switched back to US and the word is in english letters

What version of the product are you using? On what operating system?
Synerfy 1.3.1 windows XP on both comps

Please provide any additional information below.

nbolton commented 9 years ago

In my experience, the support for other layouts is not completely broken, but
somewhat operational. I use a completely custom layout for my keyboard since my
official national layout is not programmer friendly and all keys except one (ccaron
or ?) still work. My suspicion is that behaviour differs from character to character.

I cannot comment on the layout changing because I do not use multiple layouts.

nbolton commented 9 years ago

Sorry for double comment but I cannot seem to edit my previous one.

I used Wireshark to check messages sent via the network and when pressing the
unsupported character mentioned above, c gets sent instead of ?, so the problem
appears to lie with the server. If I have some free time, I will attempt to check out
the code and fix or further diagnose this problem.

nbolton commented 9 years ago

I ran synergy through a debugger and it seems the problem lies with win32. Both
characters in my case, c and ?, generate the same WPARAM and LPARAM values. There may
be a way to overcome this bug and I will try to find it, but I guess my specific case
isn't a high priority for synergy.

nbolton commented 9 years ago

I didn't have time to study the current implementation of keyboard events in synergy
but from by experience with keyboard API in Windows and OS X I think that the only
safe way is to communicate at scan codes level. This implies that the character
produced on the client computer should "rendered" as the same physical key was
pressed. The result should depend on the current active keyboard layout.

nbolton commented 9 years ago

I did some more debugging today and I think my problem differs from the problem
experienced by the original poster.

My interpretation of the OP's problem is this:
Each windows program has its own active keyboard layout. If you open windows A and B
with the default locale set to en-US and then switch window A's keyboard layout to
locale to ru-RU, window B's layout will remain en-US. Synergy is started with a
certain keyboard layout and it retains this layout, unaware of the keyboard layout in
the active window.

My interpretation could be wrong as I did not investigate it further, but I tested my
problem by creating custom keyboard layouts and switching to another layout required
me to restart synergy.

I did however create a fix for my problem, but I will open another issue for it and
attach the patch.

nbolton commented 9 years ago

Multiple keyboard layouts are somewhat broken indeed. As a workaround it is sometimes
possible to move the mouse to the server screen, switch the layout there, move to the
client, switch the layout on the client via client's normal keyboard and then
continue typing with the server's keyboard. This mainly works, except for certain
keys (if I press [ it seems to trigger something weird) and not all characters work -
in the slovenian layout seem to work, but not ?.

nbolton commented 9 years ago

Robert, check out issue #google:3 , I posted a patch that solves the Slovenian keyboard
problem. You will have to apply the patch yourself, though, since I do not know how
it would affect other keyboard layouts however, so it will probably not be included
in official Synergy, unless somebody else confirms that it is ok.

nbolton commented 9 years ago

I propose that key presses should be detected at a lower level so that Windows
language settings do not affect the characters sent to the client. I say this because
I have two issues:

nbolton commented 9 years ago

We'll move this to M2 because implementing a good solution would require to break
compatibility.

nbolton commented 9 years ago

Sorin, I think this should be assigned to you since you have a good implementation
plan. I've also re-worded the title to make the issue more apparent.

nbolton commented 9 years ago

Just to update my issue, when pressing shift + @/' key the omega symbol only appears
on my Ubuntu 9.04 client, but, on my Mac OS X client (on Mac it behaves as expected).

nbolton commented 9 years ago

Even more issues, when I press the British '|' key (to the right of the left shift
key) I get '-' (no shift) and '' (with shift). Here's the thing, I'm using a virtual
machine, with VMware Workstation 6.5.2 build-156735 - and it's the virtual machine
that's experiencing the problem.

Server: Vista
Client: Ubuntu 9.04
Virtual Machine: Ubuntu 8.04

nbolton commented 9 years ago

"https://bugs.launchpad.net/debian/+source/synergy/+bug/52534":https://bugs.launchpad.net/debian/+source/synergy/+bug/52534

nbolton commented 9 years ago

I have seen the odd behaviour with regards to virtual machines as well (be they
VMWare or VirtualBox) and Synergy.

It's a known issue it seems
"https://bugs.launchpad.net/ubuntu/+source/synergy/+bug/215745":https://bugs.launchpad.net/ubuntu/+source/synergy/+bug/215745

nbolton commented 9 years ago

I'm experiencing this issue on MacOS 10.6 client connected to Win7 server. Whenever I switch to Russian
keyboard layout on Windows - "?" signs appear in the text box I type in. Switching to Russian-PC keyboard
layout on the Mac client doesn't make any difference.

nbolton commented 9 years ago

I cannot type in Hebrew in the secondary computer

nbolton commented 9 years ago

I think I have the same issue, but I'm not sure.
I have a linux/Ubuntu server and a MacOS SnowLeopard client

when I switch from English to Hebrew I have to do both Alt+Shift (server switch layout
shortcut) and Cmd+Space (Mac switch layout shortcut) to have it switch to Hebrew...

soo annoying, any idea how to fix this?

nbolton commented 9 years ago

so true... annoying here indeed!

nbolton commented 9 years ago

I've patched this issue for the Windows server version back in 2006 (in the original
Synergy project). I'm surprised that it's still not fixed in the synergy+ fork.

Anyway, if anyone wants to be able to switch keyboard layout via Alt+Shift while on
the client desktop, apply the attached patch and rebuild the server. The patch is
against the current SVN trunk.

Please note that this patch only allows to switch the layout and doesn't fix other
issues mentioned in the comments above.

Windows server only as it's what I'm using, sorry Mac/Linux server users.

nbolton commented 9 years ago

I'm not sure if I must create another issue or if my problem is related to this one:

Server on Windows 7 with Spanish Keyboard in use. Using Synergy 1.3.5 x64
Client on Mac OS X 10.6.3 with Spanish Keyboard in use. Synergy 1.3.5

When I write on the client I can't get it to create this kind of characters:
...
I tried to debug the problem and I found that the server is sending the correct
character (225 for ), but on the client the key mapping goes wrong for some reason,
it ends up sending 00f down, 00f up, 001 down what translates to "ea". The "" key is
not correctly mapped and sends an "e" keystroke. (In the spanish layout that's the
one between ; and return for english keyboards).

Could someone tell me if I must wait for this issue (5) to be corrected or should I
open a new one?

Thanks

nbolton commented 9 years ago

I've had a problem like described in comment 29, but it was temporary. Since I'm also experiencing bug #google:9 (stickyness of modifier keys), I wonder if they are related, since right now it's behaving correctly.

My server is OS X 10.6.3 with synergy 1.3.5, Spanish keyboard layout, client is Ubuntu 10.04 with synergy 1.3.4 on both. For a moment when I typed , in the client I got . Note: I get these characters by pressing two keys in a sequence. First I press the accent key, then letter "a".

Should I downgrade OS X synergy to 1.3.4?

nbolton commented 9 years ago

I've done more testing and realised the problem I encounter is due to bug #google:9 . Since my Shift key gets stuck, it's normal that when I type "" I get "" instead. I get exactly that if I keep the shift key down in OS X while trying to type "". Sorry for the confusion. Maybe my comment helps someone else distinguish the problem too.

nbolton commented 9 years ago

I stumbled on a problem that might be related, and which could offer some clues.

Synergy2 version 1.3.1 behaves differently depending on how it is started. When launched from the commandline there are no issues, launched from a launchd (launchagent) .plist keystrokes appear on the client as if typed on a US keyboard.

Setup: Server running Synergy2 1.3.1 on SL 10.6.4, norwegian keyboard layout. Client running Synergy 1.3.1-6ubuntu1 on Ubuntu 10.04.1, also with norwegian keyboard layout.

nbolton commented 9 years ago

The same problem as in the ticket description.
server and client - both windows xp, synergy 1.4.1
Both has US and Russian layout (English(US) input language - US keyboard layout, Russian input language - russian layout). Language switch - Alt-Shift.

When I go to client screen and press Alt-Shift - language switched on client only (server language stays still). Then if i press some key - client language switchs back to server language. Looks like server send key in its language and client sets appropriate language.

So i need to go to server screen, switch language and go back to client screen - very uncomfortable.

Maybe it's possible to set server language = client language (so if i press Alt-Shift - language switched on both computers)?

nbolton commented 9 years ago

I've just had an idea that could potentially solve this issue and also expand Synergy's sharing capabilities. Synergy could simulate a USB-HID compliant keyboard attached to the client machine, transmitting the raw data across whenever the client has screen focus. This should be compatible with all keyboard layouts, provided the target operating system is configured with the correct layout. This sort of approach would also potentially allow for full support for other devices such multi-button mice, gaming input devices, attached flash drives, etc. If you could get at the raw data on the server's USB devices, you could potentially even expose devices that require drivers and allow for the sharing of essentially any USB connected device.

nbolton commented 9 years ago

I'm able to write accented characters using international keyboard (like ) but the accented characters sometimes show up as a or even a (though typing +a) this usually happens when I'm typing fast but works fine if I pause after hitting the accent key before hitting the letter ...

slowly: + a = (WORKS) fast: + a = a (DOESN'T WORK)

Are there any available fixes you guys know of ?

nbolton commented 9 years ago

Unfortunately I'm unable to use quotes and apostrophe (bug #13) on my client PC. I'm using the client to code...:-( So I ran the debug, which maybe help to solve this bug.

Server: Windows 8 x64 EN

Server keyboard setting: Dutch - United States-International

Client: Windows 7 x64 EN

Client keyboard setting: Dutch - United States-International


Server log part:

DEBUG1: hook: 0x000000de 0x00280001
DEBUG1: hook: 0x06ff27de 0x00280001
DEBUG1: hook: 0x000000de 0x80280001
DEBUG1: hook: 0x040000de 0x80280001
DEBUG1: hook: 0x000000de 0x00280001
DEBUG1: hook: 0x060227de 0x00280001
DEBUG1: event: Key char=39, vk=0xde, nagr=0, lParam=0x00280001
DEBUG1: new mask: 0x2000
DEBUG1: new mask: 0x2000
DEBUG1: event: Key char=39, vk=0xde, nagr=0, lParam=0x80280001
DEBUG1: new mask: 0x2000
DEBUG1: new mask: 0x2000
DEBUG1: hook: 0x070027de 0x00280001
DEBUG1: event: Key char=39, vk=0xde, nagr=0, lParam=0x00280001
DEBUG1: new mask: 0x2000
DEBUG1: new mask: 0x2000
DEBUG1: onKeyDown id=39 mask=0x2000 button=0x0028
DEBUG1: onKeyUp id=39 mask=0x2000 button=0x0028
DEBUG1: onKeyDown id=39 mask=0x2000 button=0x0028

Client log part:

DEBUG1: recv key down id=0x00000027, mask=0x2000, button=0x0028
DEBUG1: mapKey 0027 (39) with mask 2000, start state: 0000
DEBUG1: key 0027 is not on keyboard
DEBUG1: recv key up id=0x00000027, mask=0x2000, button=0x0028
DEBUG1: recv key down id=0x00000027, mask=0x2000, button=0x0028
DEBUG1: mapKey 0027 (39) with mask 2000, start state: 0000
DEBUG1: key 0027 is not on keyboard
nbolton commented 9 years ago

Swedish keyboard on Win7 x64 server connected to OS X Lion client (Swedish input source selected) yields horrible results:

"" key types nothing, "" (accent) key when pressed twice types two "k"s (nothing on single press) comma types a dot, dot types a hyphen, hyphen types the accent "", accent "" types two "e"s and backslash types a plus sign. I couldn't figure out what types the backslash, so I couldn't log onto my Windows server from the Mac to get the sources for the iPhone app that i'm supposed to be developing, so my workflow is disrupted and it'll be really nice if you bump the priority on this one up to "urgent".

nbolton commented 9 years ago

hi,

Im unable to use quotes and/or apostrophe in my client (macbookpro osx 10.8) in server (imac osx 10.8) works fine, but in client nothing happings when i press the key.

nbolton commented 9 years ago

Comma and semicolon are not displayed on Linux client when in Russian layout (Shift+Slash and Shift+4 keys respectively). However, on Windows client both symbols are displayed with no problem. Server in both cases is Linux.

nbolton commented 9 years ago

Any updates? Still doesn't work as it should. Maybe any additional log files needed?

http://code.google.com/p/synergy-plus/issues/detail?id=461

nbolton commented 9 years ago

Server Win8 1.4.12 Client Linux Gentoo 1.4.10

When on server Russian layout is selected the client gets only Russian text and ignores layout selected on client. In this case you have to go to server desktop to switch to English layout and only then go to the client to be able to use different layouts on the client.

nbolton commented 9 years ago

I am having exactly the same problem as Karl in comment #36 with an icelandic keyboard, using Win7 as server and ubuntu 13.04 as client. Every accented letter behaves the same , , , , . but the non-accented icelandic letters appear without a problem, , , and . Since I type fairly fast, this bug affects me quite a lot.

nbolton commented 9 years ago

Also: IF you are using the Neo2 Layout, Synergy becomes practically unusable, because in Neo2 you have three Modifier Keys which can be combined. This results in 6 different layers. Synergy does not allow more than the first 3 layers, because at least one of the modifier keys is not working:

http://www.neo-layout.org/

nbolton commented 9 years ago

Okay, I just donated again to vote for this, because this is imho the most critical bug for a "keyboard sharing" program. There's not standard US keymap users in the world. ;)

nbolton commented 9 years ago

I use Synergy server (1.4.12) on Windows XP and Synergy client (1.4.12) on Ubuntu 32 bit.

I initially had problems getting the Swedish layout work OK on the client, but the following steps solved the problems:

  1. run this in an X-terminal: setxkbmap se
  2. on Synergy server, configure the server node:
    • enable all fixes (Fix CAPS... etc)
    • for modifier keys, set Ctrl to ALT
  3. be sure to click Apply in the main screen

Then it worked.

However, Synergy often reverts back to a state which is likely an English keymap. In those cases, I click Apply, and it starts working correctly again.

It is nice to have a workaround, but it happens quite often and can be annoying when you're in the middle of typing on the client.

nbolton commented 9 years ago

I am having the same problem as Karl in comment #36, and Sigurur in comment #43. Using WinXP as server and I gues the client is irrelevant since the issue happens even when there is no client connected. I also type fairly fast, so the bug is affecting me a lot.

nbolton commented 9 years ago

I experience similar difficulties. Setup: Both server and client are Debian 7.1., Kernel 3.2.0-4-amd64, LANG=de_DE.UTF-8. My keyboard works perfectly on the server, but was switched to an english (US?) layout on the client. The client's local keyboard works without problems. Solution: As Per mentioned in comment #46, a simple call of "setxkbmap" (without any parameters) in the terminal helps. For me, no further steps were necessary.

nbolton commented 9 years ago

Same problem as #48. Server: OpenSUSE 13.1: Keyboard layout: Spanish (Works fine) Client 1: OpenSUSE 13.1 (Keyboard layout must be Spanish but it is actually US, I think) Client 2: Mac OS X 10.7.5 (Keyboard Spanish, The space bar writes "s" - annoying :(

Two votes for this. Without the right keymap Synergy loses a great part of its advantage. Thanks in advance.

nbolton commented 9 years ago

Similar to #37, I have 1 Win7 (64bit) server, 1 Win 7 (64 bit) client and 1 Ubuntu 12.04 client.
Server keyboard is set up as US International on a Dutch language version of Win7
1st client keyboard is set up as US International on an US English language version of Win7
2nd client keyboard is set up as US International on an US English language version of Ubuntu.

As far as I can tell almost everything works as expected except for the single and double quotes ( ' " )
On Ubuntu and Server everything is fine
On the Win7 client they just act WEIRD:
'+[Space] should just give the single quote, but gives nothing
"+[Space] should just give the double quote, but gives nothing
'+a = (correct)
'+c = (correct)
etc. until we reach
'+e = (should be )

"+[anything] = [nothing]

PS:
[`^] work fine
[~] doesn't seem, to work either

nbolton commented 9 years ago

I think I'm having the same experience as CescoAiel, above. I'm running Synergy server 1.4.16-r1969 on Ubuntu 12.04, and the client is Mac OSX Mavericks. My keyboard layout is "English (US, alternative international)". On the server, typing '+e makes an , as expected. On the client, though, typing '+e makes ee This may be somewhat application dependent. In the Mac Notes application, typing 'just makes an e, not ee; and typing ~n makes an Nn (instead of ).

nbolton commented 9 years ago

i use the german keyboard layout.

my host is a windows pc with keyboard and mouse.

my client is a laptop running arch linux.

if i try to write z i get a y and vice versa because it seems like synergy uses the american keyboard layout by default (ignoring the layout that has been set into the xserver configuration / environment variables)

sadly there is no aur package for arch that contains 1.4.16 so currently i'm using 1.4.15 on arch and 1.4.16 on windows 8.1

nbolton commented 9 years ago

Seeing the same issue as above. I'm using English-International keyboard layout on 2 machines, both Windows 7 64bit with regional settings EN-US. Single and double quote characters cannot be typed on the client.

nbolton commented 9 years ago

Interesting, I found a workaround. If you set the clients keyboard layout to United States and the server's keyboard to United States International, both machines will now effectively function as United States International when you use synergy!

nbolton commented 9 years ago

Same problem. I'm running 1.4.17 server on Ubuntu 14.04 and 1.4.17 client on Mac Os 10.9. The workaround suggested by Tadhg didn't work for me.

nbolton commented 9 years ago

Hi guys,

I confirm the bug. I use synergy 1.4.17 on Ubunut 14.04 and Windows 7 x64. I use a lot the international keyboard since I have to write in Italian, French and English. The key apostrophe + quotes is the only which does not work. I can only suggest to use Alt GR + that key to have the apostrophe and Alt Gr + Shift + that key to have the quotes.

nbolton commented 9 years ago

Confirming with "Polish keyboard" (RightAlt) on: server: Windows 7 64bit, Synergy 1.4.17 client: Windows 7 64bit, Synergy 1.5.0 from all "special" characters like ??????????????? only ?? work. is relatively "standard", because it appears in other languages, but I'm surprised than ?? also works.. ;)

nbolton commented 9 years ago

Hello,

I can confirm this issue on Polish layout. I work with server on Ubuntu 14.04 and Mac OS X 10.9.4 client. The issue seems to be that the altGr is not being sent from server to client. Well, not exactly altGr. On Polish layout (and I suppose on many international ones) altGr = Level 3 Shift (keycode 108). It is in no way supported by Synergy, and because your configuration files don't let us rebind keys by using their hexadecimal codes and just the pre-defined keywords, there's currently no way to have it working. Here's the xev output when I press the problematic key:

KeyPress event, serial 37, synthetic NO, window 0x4800001, root 0xc3, subw 0x0, time 8472079, (24,-17), root:(25,63), state 0x10, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES, XKeysymToKeycode returns keycode: 92 XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x4800001, root 0xc3, subw 0x0, time 8472179, (24,-17), root:(25,63), state 0x90, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES, XKeysymToKeycode returns keycode: 92 XLookupString gives 0 bytes: XFilterEvent returns: False

Plese let me know if you need anything else.

Kind regards, Rados?aw Ko?odziejczyk.

nbolton commented 9 years ago

Similar issue here than Radek with a French layout from ubuntu server to mac client. No AltGr, which means no pipe, # and few others. More a mess with a canadian qwerty keyboard and french layout :(* in a previous comment, it was suggested to use different system layout on mac client but I didn't manage to recover a full mapping sadly.

nbolton commented 9 years ago

Same 'ith the hebre' layout ) as you can see