SeanC

Emacs and Client

5 posts in this topic

I'm running the synergy client and server on machines both with Ubuntu. I find that when running emacs on the client machine, the state of the keyboard is not getting properly broadcast. It seems that only one modifier is sent (instead of the multiple modifiers that so much of emacs functionality is predicated upon.)  For example: Alt + Shift + < and Alt + Shift + > should jump to the top and the bottom of the current buffer, respectively. If I execute the command with the *local* keyboard on either client or server machine, it behaves as expected. When I exercise the emacs running on the client from the server's keyboard, what gets broadcast instead is Alt + < and Alt + >, respectively (tag searching).

Searching the server options didn't suggest anything that would change this behavior.

Synergy: synergy_1.10.1.stable_b81+8941241e_ubuntu_amd64.deb

Ubuntu: 16.04

Emacs: 24.5.1

Share this post


Link to post
Share on other sites

Sounds like a weird bug. Could you use a virtual keyboard to see what keys are being received on the client?

Share this post


Link to post
Share on other sites

Can you recommend one? The Ubuntu "universal access" keyboard doesn't echo strokes (either from the physical keyboard or from those coming over the Synergy connection.) If I have to, I could probably script something up to echo keyboard events, but I'd rather not.

A couple of other quirks:

1. This is directly related.. Ctrl + Alt + L should lock my display, but the combination of mods don't seem to map so I get no "lock".

2. This is probably unrelated, but I find that it doesn't handle long-press of keys either. For example, I was using Maya which has a special menu functionality for holding down the space bar. Rather than getting a long press, I got a press, release, press, release,..., sequence. If you like, I can push this into a separate issue. But they all fall under the common umbrella of passing keyboard events.

 

Share this post


Link to post
Share on other sites

Ah, I think I remember having that problem. Well, you could always turn the log level right up and run it from the command line. That should show you what keys are being received from the client.

Share this post


Link to post
Share on other sites

So, I did as you suggested and tried explicitly logging things. Given the complexity of the log, I tried bracketing my actions with the mouse moving in and out of the client. 

First log:

  • Mouse into client
  • Ctrl down
  • P down
  • P up
  • Ctrl up
  • Mouse out
Quote

[2018-10-29T08:19:46] INFO: entering screen
[2018-10-29T08:19:46] DEBUG1: ignoring X error: 8
[2018-10-29T08:19:48] DEBUG1: recv key down id=0x0000efe3, mask=0x0000, button=0x0025
[2018-10-29T08:19:48] DEBUG1: mapKey efe3 (61411) with mask 0000, start state: 2000
[2018-10-29T08:19:48] DEBUG1: find best:  2000 0000
[2018-10-29T08:19:48] DEBUG1: best key index 1 of 1 (exact)
[2018-10-29T08:19:48] DEBUG1: found key in group 0
[2018-10-29T08:19:48] DEBUG1: state: 2000,0000,0000
[2018-10-29T08:19:48] DEBUG1: flip: 0000 (2000 vs 0000 in 0000 - 0000)
[2018-10-29T08:19:48] DEBUG1: desired state: 0000 2000,0000,0000
[2018-10-29T08:19:48] DEBUG1: flip: 0000 (2000 vs 0000 in fffd - 6020)
[2018-10-29T08:19:48] DEBUG1: mapped to 025, new state 2002
[2018-10-29T08:19:48] DEBUG1: keystrokes:
[2018-10-29T08:19:48] DEBUG1:   025 (00000000) down
[2018-10-29T08:19:48] DEBUG1: recv key down id=0x00000070, mask=0x0002, button=0x0021
[2018-10-29T08:19:48] DEBUG1: mapKey 0070 (112) with mask 0002, start state: 2002
[2018-10-29T08:19:48] INFO: found key in group 0
[2018-10-29T08:19:48] DEBUG1: state: 2002,0000,0000
[2018-10-29T08:19:48] DEBUG1: flip: 0000 (2002 vs 0000 in 0000 - 0000)
[2018-10-29T08:19:48] DEBUG1: desired state: 0002 2002,0000,1001
[2018-10-29T08:19:48] DEBUG1: flip: 0000 (2002 vs 0002 in ffff - 6020)
[2018-10-29T08:19:48] DEBUG1: mapped to 021, new state 2002
[2018-10-29T08:19:48] DEBUG1: keystrokes:
[2018-10-29T08:19:48] DEBUG1:   021 (00000000) down
[2018-10-29T08:19:48] DEBUG1: recv key up id=0x00000070, mask=0x0002, button=0x0021
[2018-10-29T08:19:48] DEBUG1: keystrokes:
[2018-10-29T08:19:48] DEBUG1:   021 (00000000) up
[2018-10-29T08:19:48] DEBUG1: recv key up id=0x0000efe3, mask=0x0002, button=0x0025
[2018-10-29T08:19:48] DEBUG1: new state 2000
[2018-10-29T08:19:48] DEBUG1: keystrokes:
[2018-10-29T08:19:48] DEBUG1:   025 (00000000) up
[2018-10-29T08:19:50] DEBUG1: recv leave
[2018-10-29T08:19:50] INFO: leaving screen

Second log

(the keyboard sequence for jumping to the end of a buffer in emacs - the command was interpreted as Alt-> )

  • Mouse into client
  • Shift down
  • Alt down
  • < down
  • < up
  • Alt up
  • Shift up
Quote

[2018-10-29T08:19:51] INFO: entering screen
[2018-10-29T08:19:51] DEBUG1: ignoring X error: 8
[2018-10-29T08:19:53] DEBUG1: recv key down id=0x0000efe1, mask=0x0000, button=0x0032
[2018-10-29T08:19:53] DEBUG1: mapKey efe1 (61409) with mask 0000, start state: 2000
[2018-10-29T08:19:53] DEBUG1: find best:  2000 0000
[2018-10-29T08:19:53] DEBUG1: best key index 1 of 1 (exact)
[2018-10-29T08:19:53] DEBUG1: found key in group 0
[2018-10-29T08:19:53] DEBUG1: state: 2000,0000,0000
[2018-10-29T08:19:53] DEBUG1: flip: 0000 (2000 vs 0000 in 0000 - 0000)
[2018-10-29T08:19:53] DEBUG1: desired state: 0000 2000,0000,0000
[2018-10-29T08:19:53] DEBUG1: flip: 0000 (2000 vs 0000 in fffe - 6020)
[2018-10-29T08:19:53] DEBUG1: mapped to 032, new state 2001
[2018-10-29T08:19:53] DEBUG1: keystrokes:
[2018-10-29T08:19:53] DEBUG1:   032 (00000000) down
[2018-10-29T08:19:53] DEBUG1: recv key down id=0x0000efe7, mask=0x0001, button=0x0040
[2018-10-29T08:19:53] DEBUG1: mapKey efe7 (61415) with mask 0001, start state: 2001
[2018-10-29T08:19:53] DEBUG1: find best:  2001 0001
[2018-10-29T08:19:53] DEBUG1: best key index 1 of 2 (exact)
[2018-10-29T08:19:53] DEBUG1: found key in group 0
[2018-10-29T08:19:53] DEBUG1: state: 2001,0001,0001
[2018-10-29T08:19:53] DEBUG1: flip: 0000 (2001 vs 0001 in 0001 - 0000)
[2018-10-29T08:19:53] DEBUG1: desired state: 0001 2001,0001,0001
[2018-10-29T08:19:53] DEBUG1: flip: 0000 (2001 vs 0001 in fff6 - 6020)
[2018-10-29T08:19:53] DEBUG1: mapped to 040, new state 2009
[2018-10-29T08:19:53] DEBUG1: keystrokes:
[2018-10-29T08:19:53] DEBUG1:   040 (00000000) down
[2018-10-29T08:19:53] DEBUG1: recv key down id=0x0000003c, mask=0x0005, button=0x003b
[2018-10-29T08:19:53] DEBUG1: mapKey 003c (60) with mask 0005, start state: 2009
[2018-10-29T08:19:53] INFO: found key in group 0
[2018-10-29T08:19:53] DEBUG1: state: 2009,0001,0000
[2018-10-29T08:19:53] DEBUG1: flip: 0000 (2009 vs 0001 in 0000 - 0000)
[2018-10-29T08:19:53] DEBUG1: desired state: 0005 2009,0001,0001
[2018-10-29T08:19:53] DEBUG1: flip: 000c (2009 vs 0005 in ffff - 6020)
[2018-10-29T08:19:53] DEBUG1: flip: 0001 (2001 vs 0000 in 0001 - 6020)
[2018-10-29T08:19:53] DEBUG1: mapped to 03b, new state 2005
[2018-10-29T08:19:53] DEBUG1: keystrokes:
[2018-10-29T08:19:53] DEBUG1:   040 (00000000) up
[2018-10-29T08:19:53] DEBUG1:   032 (00000000) up
[2018-10-29T08:19:53] DEBUG1:   040 (00000000) down
[2018-10-29T08:19:53] DEBUG1:   03b (00000000) down
[2018-10-29T08:19:53] DEBUG1:   032 (00000000) down
[2018-10-29T08:19:53] DEBUG1: recv key up id=0x0000003c, mask=0x0005, button=0x003b
[2018-10-29T08:19:53] DEBUG1: keystrokes:
[2018-10-29T08:19:53] DEBUG1:   03b (00000000) up
[2018-10-29T08:19:53] DEBUG1: recv key up id=0x0000efe7, mask=0x0005, button=0x0040
[2018-10-29T08:19:53] DEBUG1: new state 2001
[2018-10-29T08:19:53] DEBUG1: keystrokes:
[2018-10-29T08:19:53] DEBUG1:   040 (00000000) up
[2018-10-29T08:19:53] DEBUG1: recv key up id=0x0000efe1, mask=0x0001, button=0x0032
[2018-10-29T08:19:53] DEBUG1: new state 2000
[2018-10-29T08:19:53] DEBUG1: keystrokes:
[2018-10-29T08:19:53] DEBUG1:   032 (00000000) up
[2018-10-29T08:20:03] DEBUG1: request for clipboard 519, target TARGETS (514) by 0x04600006 (property=GDK_SELECTION (383))
[2018-10-29T08:20:03] DEBUG1: success

Addendum

In the process of grokking the previous log, I tried reversing the order that I pressed shift and alt, and found that if I hit alt *first*, then the full command went through properly.

Postscript

Furthermore, I believe I have to retract my earlier comment about locking the desktop not working -- it does.

Edited by SeanC

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now