[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Using .XCompose [resend of xev_output_annotated.txt]



On Thu, 9 Jul 2020 davidson wrote:
[snip]

Finally, in case it is of interest to anyone, in the attached file
"xev_output_annotated.txt" is some xev(1) output with commentary
that gives a detailed close-up of performing steps 4 through 6 in an
xterm. (As with the system synopsis, if it happens to "get lost"
I'll just post it the message body of a follow-up.)

It appears that the process of attaching that file to my previous
message caused alteration of those bytes encoding the malayalam
characters. This affected all lines beginning with either

 XLookupString gives N bytes:

or

 XmbLookupString gives N bytes:

for N greater than 0.

The remainder of this message is (hopefully) a more faithful
representation of the file (previously attached as
"xev_output_annotated.txt").

____________________________________________________________________

$ man xev
[...]
DESCRIPTION

  Xev creates a window and then asks the X server to send it events
  whenever anything happens to the window (such as it being moved,
  resized, typed in, clicked in, etc.).  You can also attach it to an
  existing window.  It is useful for seeing what causes events to
  occur and to display the information that they contain; it is
  essentially a debugging and development tool, and should not be
  needed in normal usage.

This is the command I issued from within an xterm (uxterm, really) to
launch xev and attach it to that terminal's window.

$ xev -id $WINDOWID -event keyboard # I press enter, of course

# And here is the release of the enter key:

KeyRelease event, serial 18, synthetic NO, window 0x60000f,
    root 0x102, subw 0x0, time 76502401, (1362,764), root:(1364,766),
    state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
    XLookupString gives 1 bytes: (0d) ""
    XFilterEvent returns: False

# Next, I strike the capslock key to enter the Malayalam keymap, "ml".
# The capslock key's keycode happens to be 66. This is a relatively
# low-level identifier, mechanical, relatively meaningless in itself,
# fixed by factual accident.
#
# Its keysym, under my configuration, is apparently <ISO_Next_Group>.
#
# A keysym is an identifier of somewhat higher abstraction than a
# keycode, and is meant to *mean* something. (I mean, just compare the
# two names to see this!)
#
# The following *three* records correspond to striking this key.
#
# NB: For some reason, each key struck seems to correspond to *three*
#     records in the xev output:
#
#     1. a KeyRelease event (kind of weird, but that's how it is).
#     2. a KeyPress event.
#     3. a KeyRelease event.

KeyRelease event, serial 21, synthetic NO, window 0x60000f,
    root 0x102, subw 0x0, time 76506392, (1362,764), root:(1364,766),
    state 0x0, keycode 66 (keysym 0xfe08, ISO_Next_Group), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 21, synthetic NO, window 0x60000f,
    root 0x102, subw 0x0, time 76506392, (1362,764), root:(1364,766),
    state 0x0, keycode 66 (keysym 0xfe08, ISO_Next_Group), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 21, synthetic NO, window 0x60000f,
    root 0x102, subw 0x0, time 76506480, (1362,764), root:(1364,766),
    state 0x2000, keycode 66 (keysym 0xfe08, ISO_Next_Group), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

# Next, I hold down a shift key (left shift, as it happens).
#
# NB: The following *two* records correspond to this. First a
# KeyRelease, then a KeyPress.

KeyRelease event, serial 21, synthetic NO, window 0x60000f,
    root 0x102, subw 0x0, time 76509510, (1362,764), root:(1364,766),
    state 0x2000, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 21, synthetic NO, window 0x60000f,
    root 0x102, subw 0x0, time 76509510, (1362,764), root:(1364,766),
    state 0x2000, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

# Then, still holding down the shift key, I strike the key labeled "U"
# on my standard US laptop keyboard.
#
# NB: The next *four* records correspond to this action.
#
#       * The first two events are due to holding down the key labeled
#         "U" (KeyRelease event followed by KeyPress),
#
#       * followed by a third, MAGICALLY INTERPOLATED, KeyPress event
#         (presumably due to the relevant entry in ~/.XCompose),
#
#       * and wrapped up with the KeyRelease event corresponding to
#         releasing that "U" labeled key.

KeyRelease event, serial 21, synthetic NO, window 0x60000f,
    root 0x102, subw 0x0, time 76509907, (1362,764), root:(1364,766),
    state 0x2001, keycode 30 (keysym 0x1000d19, U0D19), same_screen YES,
    XLookupString gives 3 bytes: (e0 b4 99) "ങ"
    XFilterEvent returns: False

KeyPress event, serial 21, synthetic NO, window 0x60000f,
    root 0x102, subw 0x0, time 76509907, (1362,764), root:(1364,766),
    state 0x2001, keycode 30 (keysym 0x1000d19, U0D19), same_screen YES,
    XLookupString gives 3 bytes: (e0 b4 99) "ങ"
    XmbLookupString gives 3 bytes: (e0 b4 99) "ങ"
    XFilterEvent returns: True

# This one is THE MAGIC!

KeyPress event, serial 21, synthetic NO, window 0x60000f,
    root 0x102, subw 0x0, time 76509907, (1362,764), root:(1364,766),
    state 0x2001, keycode 0 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 9 bytes: (e0 b4 99 e0 b5 8d e0 b4 99) "ങ്ങ"
    XFilterEvent returns: False

KeyRelease event, serial 21, synthetic NO, window 0x60000f,
    root 0x102, subw 0x0, time 76509998, (1362,764), root:(1364,766),
    state 0x2001, keycode 30 (keysym 0x1000d19, U0D19), same_screen YES,
    XLookupString gives 3 bytes: (e0 b4 99) "ങ"
    XFilterEvent returns: False

# And now I release the shift key.

KeyRelease event, serial 21, synthetic NO, window 0x60000f,
    root 0x102, subw 0x0, time 76510083, (1362,764), root:(1364,766),
    state 0x2001, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

# Having wrapped up my experiment (and happily observing the desired
# character echoed to the terminal), I strike the capslock key to
# return to a more familiar-to-me keymap. Three records, as per usual,
# correspond to this action: Release, Press, Release.

KeyRelease event, serial 21, synthetic NO, window 0x60000f,
    root 0x102, subw 0x0, time 76514882, (1362,764), root:(1364,766),
    state 0x2000, keycode 66 (keysym 0xfe08, ISO_Next_Group), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 21, synthetic NO, window 0x60000f,
    root 0x102, subw 0x0, time 76514882, (1362,764), root:(1364,766),
    state 0x2000, keycode 66 (keysym 0xfe08, ISO_Next_Group), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 21, synthetic NO, window 0x60000f,
    root 0x102, subw 0x0, time 76514968, (1362,764), root:(1364,766),
    state 0x0, keycode 66 (keysym 0xfe08, ISO_Next_Group), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

# Here I hold down the control key, as a preliminary step to entering
# Ctrl-c, to kill xev. Two events (Release followed by Press),
# correspond to this preliminary action. The victim of the killing
# strike --'c'-- has obviously failed to record its own assassination.

KeyRelease event, serial 21, synthetic NO, window 0x60000f,
    root 0x102, subw 0x0, time 76517083, (1362,764), root:(1364,766),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 21, synthetic NO, window 0x60000f,
    root 0x102, subw 0x0, time 76517083, (1362,764), root:(1364,766),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

--
 The day will come              |  Last words, August Spies (1855--1887).
 When our silence will be       |  Hanged, by the state of Illinois,
 More powerful than             |  alongside fellow journalists
 The voices you strangle today  |  Adolf Fischer and Albert Parsons.

Reply to: