Sticky shift key with synergy in Fedora 12

My synergy setup at work is relatively simple. I have a MacBook Pro running Snow Leopard that acts as a synergy server and a desktop running Fedora 12 as a synergy client. On the Mac, I use SynergyKM to manage the synergy server. The Fedora box uses my gdm strategy for starting synergy at the login screen and in GNOME.

I kept having an issue where the shift key would become stuck regardless of the settings I set for the client or server. The halfDuplexCapsLock configuration option had no effect. After installing xkeycaps, I found that both shift keys were getting stuck if I brought the mouse back and forth between Mac and Fedora twice.

I decided to run a test. I started the client with the debug argument and moved the mouse to my Fedora box. At that point, I pressed the letter 'a' and saw:

DEBUG1: CXWindowsKeyState.cpp,195:   032 (00000000) up
DEBUG1: CXWindowsKeyState.cpp,195:   03e (00000000) up
DEBUG1: CXWindowsKeyState.cpp,195:   026 (00000000) down
DEBUG1: CXWindowsKeyState.cpp,195:   032 (00000000) down
DEBUG1: CXWindowsKeyState.cpp,195:   03e (00000000) down
DEBUG1: CXWindowsKeyState.cpp,195:   026 (00000000) up

I brought the mouse back to the Mac and then back to Fedora. I pressed 'a' again and saw:

DEBUG1: CXWindowsKeyState.cpp,195:   026 (00000000) down
DEBUG1: CXWindowsKeyState.cpp,195:   026 (00000000) up
DEBUG1: CXWindowsKeyState.cpp,195:   026 (00000000) down
DEBUG1: CXWindowsKeyState.cpp,195:   026 (00000000) up

After dumping the keyboard layout with xmodmap I found the keys that corresponded with the key numbers:

  • 032 - Left shift
  • 03e - Right shift
  • 026 - a

If I tapped the left shift, I could clear the key press, but I couldn't clear the right shift key (it was stuck down according to Fedora's X server). When I hooked up a physical keyboard and mouse, I was able to use them normally without any keybinding problems.

The root cause: When synergy started in /etc/gdm/PreSession/Default after the gdm login, the keyboard layout wasn't set up properly. The X server was setting up the keyboard layout later in the startup process and this confusion caused the shift keys to get stuck. Fedora 12 uses evdev to probe for keyboards during X's startup and eventually settles on a default layout if none are explicitly defined.

The fix: I added the synergy startup to the GNOME startup items and it works flawlessly.

Printed from: http://rackerhacker.com/2010/03/03/sticky-shift-key-with-synergy-in-fedora-12/ .
© Major Hayden 2012.

1 Comment   »

  • I'm having the exact same issue you're describing here on an Ubuntu based distro, crunchbang linux. (i.e, the Right shift key "sticks" and the Left shift key will clear the shift and allow me to type without the shift, I confirmed by using the DEBUG1 option on the synergy client) However, this always happens to me, and even when I start the synergy client manually after login.

    Do you have any suggestions as to what I can try? (or should I just switch to a Fedora based distro?)

Trackbacks/Pingbacks

  1. Automatically starting synergy in GDM in Ubuntu/Fedora | Racker Hacker

RSS feed for comments on this post

Leave a Reply

 

  • Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you find the information useful. If you spot something that's incorrect or confusing, please write a comment and let me know. Drop me a line if there's something you want to know more about and I'll do my best to write a post on the topic.
    -- Major Hayden

    Flattr this