0

I've got a Dell Latitude and eventually use xedit under cygwin-X (and via ssh -X also on Linux machines). I need the CTRL-_ key to undo edits. That key combination is recognized by e.g. xemacs (for a different purpose). As far as I can see the keystroke in X applications is received as ASCII 31 ("Unit Separator"). What code does xedit expect, and if it isn't ASCII 31, how can I map it to the expected one?

1

X applications interpret events, not keystrokes. If you ran xev, you might see something like this (underscore is a shifted key on my keyboard):

KeyPress event, serial 34, synthetic NO, window 0xe00001,
    root 0x111, subw 0xe00002, time 1812782646, (61,35), root:(81,78),
    state 0x0, keycode 67 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 34, synthetic NO, window 0xe00001,
    root 0x111, subw 0xe00002, time 1812783382, (61,35), root:(81,78),
    state 0x4, keycode 68 (keysym 0xffe2, Shift_R), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 34, synthetic NO, window 0xe00001,
    root 0x111, subw 0xe00002, time 1812784150, (61,35), root:(81,78),
    state 0x5, keycode 35 (keysym 0x5f, underscore), same_screen YES,
    XLookupString gives 1 bytes: (1f) ""
    XmbLookupString gives 1 bytes: (1f) ""
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0xe00001,
    root 0x111, subw 0xe00002, time 1812784374, (61,35), root:(81,78),
    state 0x5, keycode 35 (keysym 0x5f, underscore), same_screen YES,
    XLookupString gives 1 bytes: (1f) ""
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0xe00001,
    root 0x111, subw 0xe00002, time 1812785271, (61,35), root:(81,78),
    state 0x5, keycode 68 (keysym 0xffe2, Shift_R), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0xe00001,
    root 0x111, subw 0xe00002, time 1812785335, (61,35), root:(81,78),
    state 0x4, keycode 67 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

xedit uses the X Toolkit translations resource to convert those events into an action, e.g., using the default resource-setting compiled into TextTr.c:

":c<Key>_:"     "undo()\n"

So (unless you're overriding the default resources), it's simply the control modifier plus the underscore (however your keyboard produces it).

xedit would not recognize the analogous ASCII ^_.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.