Summary: | X11 unable to generate the RECORD SEPARATOR control character (ctrl-^) properly if asciicircum is a dead key | ||||||
---|---|---|---|---|---|---|---|
Product: | xorg | Reporter: | Nuno J. Silva <nunojsg+bugsfdo> | ||||
Component: | Lib/Xlib | Assignee: | Xorg Project Team <xorg-team> | ||||
Status: | RESOLVED MOVED | QA Contact: | Xorg Project Team <xorg-team> | ||||
Severity: | normal | ||||||
Priority: | medium | CC: | freedesktop-bugs | ||||
Version: | unspecified | ||||||
Hardware: | Other | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
i915 platform: | i915 features: | ||||||
Attachments: |
|
This is intentional. This circumflex is produced by a composed sequence, which is defined something like this: <dead_circumflex> <dead_circumflex> : "^" asciicircum In general the "~" there can be anything, e.g. "hello world". It's a different mechanism from the usual keysym->string translation. In any case this bug belongs in libX11 not xkeyboard-config. Here are some details on your trace if you're interested: The ctrl xor is normally done by XkbTranslateKeySym(), which is called by XLookupString and also by XmbLookupString for "throughed" (non-filtered, unaltered, not part of a compose sequence) events. When you do <dead_circumflex><dead_circumflex>, the key events are processed by Xlib's Compose mechanism up until the second key press, which is filtered. This second key press event is redelivered to the client, but altered in two ways: 1. The keycode is changed to the special keycode 0. 2. Some metadata is set to indicate a complete sequence was composed. When you call XLookupString on this event, you always get NoSymbol since the keycode is 0. XLookupString doesn't know anything about Compose or dead keys. When you call XmbLookupString (which is Compose-aware) on this event, you get the composed asciicircum keysym and the "^" string as specified. In this code path XkbTranslateKeySym() is not called. [Note that the "^" part in the compose sequence definition can be omitted. In this case the asciicircum string representation is used, but this is done ahead of time.] However, if you *really* want the ctrl-xor behavior, you can simulate it with this snippet in your ~/.XCompose file: include "%L" <dead_circumflex> Ctrl <dead_circumflex> : "\x1e" asciicircum Thanks a lot for the detailed explanation of what is happening here. As this belongs to libX11, I suppose I should assign this bug to a different "product"? Which one? (Also, thanks for the workaround, it works nicely!) I've tried to use the ~/.XCompose out of curiosity. I am normally using `setxkbmap -layout de -variant nodeadkeys` where this is not a problem, but then tried it using `setxkbmap -layout de`, where it does not appear to make a difference, i.e. I cannot switch between tabs in Firefox. I have used `im-config` to use "xim" as input method ($GTK_IM_MODULE=xim). -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/lib/libx11/issues/38. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.
Created attachment 108527 [details] xev output for ctrl-^ I am using the Finnish keyboard layout, but I have also tested this with the Portuguese (QWERTY) layout: I am not able to generate a RECORD SEPARATOR control character, also known as ctrl-^, if I hold down control while generating dead_circumflex twice. According to xev, the dead_circumflex events are XORed with 0x40, but the asciicircum event is not. (I am aware that, for some reason, I can generate ctrl-^ by pressing ctrl and "6" at the same time.) I will attach some xev output from when I tried to enter ctrl-^ using the Finnish layout. This control character is used in some programs, including at least mosh and Firefox with pentadactyl. The control character is correctly generated in the Linux virtual console by pressing ctrl and the key combination that produces the dead ^ at the same time.