xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Opened 6 months ago

Closed 5 months ago

Last modified 3 months ago

#2899 closed defect (worksforme)

Create a shortcut keyboard events logger

Reported by: stdedos Owned by: stdedos
Priority: minor Milestone: 4.1
Component: server Version: 3.0.x
Keywords: Cc:

Description (last modified by stdedos)

From #2882: Create a not-so-verbose keyboard events logger that fires only on sending/receiving a finalized shortcut.

Assume "typical" shortcuts, e.g. need to contain at least Ctrl, Alt, or Winkey as modifiers.

Change History (7)

comment:1 Changed 5 months ago by Antoine Martin

Owner: changed from Antoine Martin to stdedos

FYI: we don't send "shortcuts" to the server, just key events. Whatever the xpra server, X11 server or X11 client application decides to do with this event is up to them. They may or may not handle it as a shortcut.


r27831 makes it possible to specify the loggers to enable / disable more selectively. ie: -d keyboard+events will only enable logging for loggers that match both categories. -d keyboard,events will continue to affect loggers that match either category.


Rather than adding yet another logging category for shortcuts, which could be confusing since the term already has a different meaning in xpra (see --keyboard-shortcut=), r27840 just makes it possible to enable key event logging for any key (matched by name, case insensitive), ie:

XPRA_DEBUG_KEY_EVENTS=control,V,backspace xpra attach
XPRA_DEBUG_KEY_EVENTS=shift,alt,super xpra attach

comment:2 Changed 5 months ago by stdedos

Description: modified (diff)

comment:3 Changed 5 months ago by stdedos

While I see that somehow working (haven't tried to actually to use it to debug), I think you might have messed up the logging code:

"Xpra-Python3-x86_64_4.1-r27841\xpra_cmd" attach ssh://user@ip/3 --ssh="plink -ssh -agent" --modal-windows=no --title="@title@ on @@/@server-display@" --headerbar=off --opengl=no --bandwidth-limit=6Mbps

XPRA_CUSTOM_TITLE_BAR=0
XPRA_EXECUTABLE=Xpra-Python3-x86_64_4.1-r27841
XPRA_REPAINT_ALL=1
XPRA_SCROLL_ENCODING=0

2020-11-09 09:05:27,674 Xpra GTK3 client version 4.1-r27841 64-bit
2020-11-09 09:05:27,676  running on Microsoft Windows 10
2020-11-09 09:05:28,963 GStreamer version 1.18.0 for Python 3.8.6 64-bit
2020-11-09 09:05:29,306 created named pipe 'Xpra\6304'
2020-11-09 09:05:29,682 keyboard layout code 0x409
2020-11-09 09:05:29,686 identified as 'United States - English' : us
2020-11-09 09:05:30,011  keyboard settings: layout=us
2020-11-09 09:05:30,017  desktop size is 4160x1440 with 1 screen:
2020-11-09 09:05:30,018   Default (1100x381 mm - DPI: 96x96) workarea: 4160x1400
2020-11-09 09:05:30,019     Generic PnP Monitor 1600x900 at 0x534 (309x174 mm - DPI: 131x131) workarea: 1600x860 at 0x534
2020-11-09 09:05:30,019     C32JG5x 2560x1440 at 1600x0 (697x392 mm - DPI: 93x93) workarea: 2560x1400 at 1600x0
2020-11-09 09:05:34,259 enabled remote logging
2020-11-09 09:05:34,263 Xpra GTK3 X11 server version 3.0.12-r27620 64-bit
2020-11-09 09:05:34,265  running on Linux Ubuntu 16.04 xenial
2020-11-09 09:05:34,284 Attached to 0.0.0.0:22
2020-11-09 09:05:34,290  (press Control-C to detach)


(xpra_cmd:6304): Pango-WARNING **: 09:05:34.729: couldn't load font "Bitstream Vera Sans Not-Rotated 14.662109375", falling back to "Sans Not-Rotated 14.662109375", expect ugly output.
2020-11-09 09:05:35,766 UI thread is now blocked
2020-11-09 09:05:35,991 UI thread is running again, resuming
2020-11-09 09:05:42,856 key event <GTKKeyEvent object, contents: {'modifiers': ['control', 'mod2'], 'keyname': 'Control_L', 'keyval': 65507, 'keycode': 17, 'group': 0, 'string': '', 'pressed': True}> on window 1038
2020-11-09 09:05:43,814 key event <GTKKeyEvent object, contents: {'modifiers': ['mod2'], 'keyname': 'Control_L', 'keyval': 65507, 'keycode': 17, 'group': 0, 'string': '', 'pressed': False}> on window 1038
[...]
2020-11-09 09:47:53,820 key event <GTKKeyEvent object, contents: {'modifiers': ['control', 'mod2'], 'keyname': 'Control_L', 'keyval': 65507, 'keycode': 17, 'group': 0, 'string': '', 'pressed': True}> on window 1038
2020-11-09 09:47:53,934 key event <GTKKeyEvent object, contents: {'modifiers': ['mod2'], 'keyname': 'Control_L', 'keyval': 65507, 'keycode': 17, 'group': 0, 'string': '', 'pressed': False}> on window 1038
2020-11-09 09:48:00,138 system is suspending
2020-11-09 09:48:18,753 Warning: long timer waiting time,
2020-11-09 09:48:18,768  UI thread polling waited 13.3 seconds longer than intended (13.8 vs 0.5)
2020-11-09 09:48:23,097 UI thread is now blocked
2020-11-09 09:48:24,491 UI thread is running again, resuming
2020-11-09 09:48:24,982 sending updated screen size to server: 2560x1440 with 1 screens
2020-11-09 09:48:25,641   Default (677x381 mm - DPI: 96x96)
2020-11-09 09:48:25,832     C32JG5x (697x392 mm - DPI: 93x93)
2020-11-09 09:48:25,872 screen size change: will reinit the windows
2020-11-09 09:48:26,332 UI thread is running again, resuming
2020-11-09 09:49:19,922 server ping timeout - waited 60 seconds without a respons

comment:4 Changed 5 months ago by Antoine Martin

I think you might have messed up the logging code:
...

You mean spurious events? r27871 fixes that.

comment:5 in reply to:  4 Changed 5 months ago by stdedos

Replying to Antoine Martin:

I think you might have messed up the logging code:
...

You mean spurious events? r27871 fixes that.

If only I knew what "spurious events" were :-D
But I guess yes

comment:6 Changed 5 months ago by Antoine Martin

Resolution: worksforme
Status: newclosed

comment:7 Changed 3 months ago by migration script

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2899

Note: See TracTickets for help on using tickets.