GNU bug report logs - #55660
29.0.50; PGTK degrades to terminal-compatible keyboard events

Previous Next

Package: emacs;

Reported by: Derek Upham <derek_upham <at> mailfence.com>

Date: Thu, 26 May 2022 14:44:01 UTC

Severity: normal

Tags: moreinfo

Merged with 49211, 51002, 53200, 55362, 56653

Found in versions 28.0.50, 29.0.50

Done: Po Lu <luangruo <at> yahoo.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 55660 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Derek Upham <derek_upham <at> mailfence.com>
Cc: 55660 <at> debbugs.gnu.org
Subject: Re: bug#55660: 29.0.50; PGTK degrades to terminal-compatible
 keyboard events
Date: Fri, 27 May 2022 08:19:51 +0800
Derek Upham <derek_upham <at> mailfence.com> writes:

> Meaningful control keys in ASCII are @, A-Z, [ \ ] ^ and _ (0x40 through
> 0x5f).  VT100 terminals use the Control key to zero-out the top two bits
> of seven, leaving us with 2^5=32 characters.  The above control keys
> happen to be a bank of 32 that are all graphical and easy to reach.)  I
> have old notes to myself that say that VT100 terminals do a little extra
> mapping: Control and `?' (0x3f) sends the DEL keycode (0xff); Emacs
> itself seems to map Control and `/' (0x2f) to the same keycode as
> Control and `_' (0x1f)).
>
> Window system interfaces like GTK track individual keypresses, and Emacs
> supports binding other keys with Control:
>
>   (global-set-key [(control ?<)] 'my-left-command)
>   (global-set-key [(control ?>)] 'my-right-command)
>
> Some terminals even send special character sequences to Emacs that
> encode the Control modifier alongside the ">" character.  Xterm is one
> of those, if you use the "xterm" terminal type.
>
> I was experimenting with Emacs configurations (in a weekly snapshot) and
> discovered that the PGTK interface does not support arbitrary Control
> modifiers.  I can send any of the ASCII control keys listed above, but
> for all others PGTK ignores the Control modifier.  Control-> turns into
> a plain ">", for example.
>
> These configuration options have the bug:
>
>   --with-x-toolkit=gtk3
>   --with-xwidgets=yes
>   --with-pgtk=yes
>
> These configuration options understand Control-> correctly.
>
>   --with-x-toolkit=gtk3
>   --with-xwidgets=yes
>   --with-pgtk=no
>
> I'm aware that PGTK is under active development and unreliable, and the
> immediate workaround is "stop using PGTK".
>
> Derek

What happens if you turn off input method support, by evaluating
(pgtk-use-im-context nil)?  In general, these problems are not with
Emacs, but with GTK input method modules, and should be reported to
their developers instead.

Emacs never "degrades" to "terminal-compatible" input events when using
a window system.  We directly use whatever it reports.




This bug report was last modified 2 years and 148 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.