From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#65068: 29.1; xkb-interception interaction causes problems with key combinations Date: Thu, 24 Aug 2023 20:41:41 +0800 Message-ID: <874jko629m.fsf@yahoo.com> References: <87v8dv2ib3.fsf@gmx.at> <871qgdyted.fsf@yahoo.com> <87sf8kbesn.fsf@gmx.at> <87r0o3lqpi.fsf@yahoo.com> <87zg2rberr.fsf@gmx.at> <87ttszi205.fsf@yahoo.com> <87350jxeof.fsf@gmx.at> <874jkyiiel.fsf@yahoo.com> <87y1iawfur.fsf@gmx.at> <87zg2qgzdu.fsf@yahoo.com> <87bkf673cm.fsf@gmx.at> <87leeagu1f.fsf@yahoo.com> <87lee79lvg.fsf@gmx.at> <87sf8a81ht.fsf@gmx.at> <87v8d66l9c.fsf@yahoo.com> <87o7ix97b0.fsf@gmx.at> <87msyh71hg.fsf@yahoo.com> <87v8d466gq.fsf@gmx.at> <87pm3c69xa.fsf@yahoo.com> <87il94sew9.fsf@gmx.at> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14363"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 65068@debbugs.gnu.org To: Alexander =?UTF-8?Q?Pr=C3=A4hauser?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 24 14:43:26 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qZ9gL-0003ZP-Qw for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Aug 2023 14:43:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZ9fv-0005lW-JS; Thu, 24 Aug 2023 08:42:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZ9fu-0005lM-Is for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 08:42:58 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZ9fu-0003UZ-Ap for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 08:42:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZ9fy-0004Yu-1l for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 08:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Aug 2023 12:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65068 X-GNU-PR-Package: emacs Original-Received: via spool by 65068-submit@debbugs.gnu.org id=B65068.169288092517452 (code B ref 65068); Thu, 24 Aug 2023 12:43:02 +0000 Original-Received: (at 65068) by debbugs.gnu.org; 24 Aug 2023 12:42:05 +0000 Original-Received: from localhost ([127.0.0.1]:36338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZ9f2-0004XO-LH for submit@debbugs.gnu.org; Thu, 24 Aug 2023 08:42:05 -0400 Original-Received: from sonic309-20.consmr.mail.ne1.yahoo.com ([66.163.184.146]:34377) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZ9ez-0004Wp-Fs for 65068@debbugs.gnu.org; Thu, 24 Aug 2023 08:42:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1692880910; bh=x7nQ4RZ9tEDoJm8lUMwWVBHPjWuq/vLWwjW8tQzYkDI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=omS30CZSp1OmVcoHoCk2uvfx5U7j9ZqtIP2UYOz6viZtUNjbu/cNrTfPY3qSZDo5NOFO1KuO505taZGkkOiLj5UE0QuAEfc2WsWEeQE65pFQdX7Yo6u3pcGeXAN9NePqSFR/3dtGApC4qgD0OdGflUHh4gINRWI0W9w05B2F9tt745jZMRxGAffok0E/BAfa7YV8CeddLNs6wfE8ymn++GctwGKcCxJ/3yWhzu1k2vZf7FxDokuVnTvuPU0iKxrpThKCM4fGjvPfxOWq9Im6KmbyVdjWvbKKedwIQgV7cQJ4zq2RtS4PNMaalgZQv8Kgz8OGpjOwiiiQu73OPydD9A== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1692880910; bh=WMy9PgWJqWM6KOzMRf5MmMrJP+GxjQ0PViLWLQhQsQr=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=L2zQ9R9G/afPJOLZRod6FkqtUP6rwUo5mGqxKxKFAspqPTmjPWy27Qa6jw3WHdzEYusKx1YhdvI1kJCJRoMwpFlYnER/r9Yee988Dn1rkNcRfI9Mjv//ZjmopnwwNvl/2XzolqS1Jhi08HQvxt3Lh7LKb/vlElBN8ocRNEcPSJFGNHq8Pa0DZDbs4O3ZX6ARs6xABJwD+jiBKaaaXns8/Re1uX1ptSwXTzE9MnC0rZkfFyMPtEnd7a27dW8HKRSQXjV6oPyMbP4R5CH24i6pe6OFCFQ1VbRblRIhdvRwZeQyijkYoR3FrUWkNkIlxj0AaJfl+/nzTgqyTpIFQUztRA== X-YMail-OSG: m5NEdkgVM1nE_Zmp.geJwSPmwm6Y69aFn3yTKhzhkT140hL1MRmDQK_9m5pExbC jBuionD9PZBn79BQ.cmcbuQJZwtEsKF.fl5Mbv8Eisb1SYh7ADqBezN1iipcW8jaGDCJ3osHm_2g AjN7gl._peV2EWAh8kfalMwvoZhV9NrJVROTfg7Fq3FbqFCeWm991lO4hUzs9mU0pRsDRTJcw_p_ BCsJAg4yRXEnD1Il2TVFNfdygtiA2rt.5HxE3S9EaTeklDvuA8tQIAGP6fcozMu9NiZBos8V17r0 8RMx9i6urkRgCiceq3txOcMuOz2kSKBitblfxzf9BzSJbUtuqMwFKTx1MWCOWRn862f9.1PWmyrv 6WLT35w_A_3QQFyGV6ajcQciiczBqLhQgmDU069BXCWbXHH.TGmiRNtIdMuGPFiUCWP_Uz0p14pz epo9wWraEVsuLqbjATk3pZgAtmlY6noSN8KiEE0tWHPED9Fbm.6F3aEOxICk7SXh1AQoCORSk_MY HpyntOI05BWmPcZMV_bk4wtycJpB3NIyvyQzY9_ordtIE2NqnMdnBBpnEEXtGpWJlnkGM4o7vvdC 0hZGsWpdNDpX3a3xiLNpuXKjkL8mLG3m_p0k_.YXeLJQqHqjcdMO7jYznkK8BuV0PGmbAhAdkCaE tur3tDdG72zyWdjPP4RxbmrEZUNnfKaKX9CoZEIKeaiNDZykeZj45p8lbxIO71sYfFy5Tpgkq2qm 4dpd03FcwpKPaCHHCKpc1BmyMl8UbdeP03Jk_igXVwTHKQbnIQSE5Bcs95obsAVtzH3LPIGuod.f adb_sIMq2DquDWwIs77Qp2meovZYKbadPE14tjPQBr X-Sonic-MF: X-Sonic-ID: 1bc4d7a8-4bef-467b-bf03-768912963218 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ne1.yahoo.com with HTTP; Thu, 24 Aug 2023 12:41:50 +0000 Original-Received: by hermes--production-sg3-69654d8bd-cgvfq (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID d653c0ee492f79fb02bb107862239f02; Thu, 24 Aug 2023 12:41:46 +0000 (UTC) In-Reply-To: <87il94sew9.fsf@gmx.at> ("Alexander =?UTF-8?Q?Pr=C3=A4hauser?="'s message of "Thu, 24 Aug 2023 16:12:55 +0200") X-Mailer: WebService/1.1.21732 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268332 Archived-At: Alexander Pr=C3=A4hauser writes: > It does seem to register the correct level shifts now, but it seems to > evaluate each key immediately after having been > pressed. For instance, when I press Space-CapsLock-U, this should > evaluate to C-; and it does, but this is the output > I'm receiving in-between: > > is undefined > C-' is undefined > C-; is undefined > > Po Lu [2023-08-24 Thu 17:56] wrote: > >> Alexander Pr=C3=A4hauser writes: >> >>> The significance of the U-key is that when I press Space-CapsLock-U >>> (or any other key, I think), it doesn't send the signal >>> that is configured by xkb but the corresponding key of the default >>> English keymap (u for the U-key), which really >>> shouldn't happen. Anyway, here the output after pressing the >>> sequence >>> you wanted: >>> >>> keycode: 48, keysym: 65027, 0 >>> keycode: 192, keysym: 269025093, 0 >>> keycode: 37, keysym: 65507, 0 >>> keycode: 37, keysym: 65507, 0 <- Control_R >>> keycode: 48, keysym: 65027, 0 <- AC11, ISO_Level3_Shift >>> keycode: 192, keysym: 269025093, <- XF86Launch5 >> >> This attests to Emacs registering the keysyms you meant it to. If >> ISO_Level3_Shift is registered as a modifier key, it should not be >> translated into keyboard input afterwards, let alone the original >> apostrophe symbol. >> >> Does this patch resolve your problems with typing level 3 characters >> coupled with Control? >> >> diff --git a/src/xterm.c b/src/xterm.c >> index 6a1642ff56e..7391041ea0c 100644 >> --- a/src/xterm.c >> +++ b/src/xterm.c >> @@ -23734,6 +23734,7 @@ handle_one_xevent (struct x_display_info >> *dpyinfo, >> ptrdiff_t i; >> unsigned int old_state; >> struct xi_device_t *device, *source; >> + bool is_modifier_key; >> coding =3D Qlatin_1; >> @@ -24175,17 +24176,7 @@ handle_one_xevent (struct x_display_info >> *dpyinfo, >> /* Any "vendor-specific" key is ok. */ >> || (keysym & (1 << 28)) >> || (keysym !=3D NoSymbol && nbytes =3D=3D 0)) >> - && ! (IsModifierKey (keysym) >> - /* The symbols from XK_ISO_Lock >> - to XK_ISO_Last_Group_Lock >> - don't have real modifiers but >> - should be treated similarly to >> - Mode_switch by Emacs. */ >> -#if defined XK_ISO_Lock && defined XK_ISO_Last_Group_Lock >> - || (XK_ISO_Lock <=3D keysym >> - && keysym <=3D XK_ISO_Last_Group_Lock) >> -#endif >> - )) >> + && !is_modifier_key) >> { >> STORE_KEYSYM_FOR_DEBUG (keysym); >> /* make_lispy_event will convert this to a >> symbolic >> @@ -24204,7 +24195,11 @@ handle_one_xevent (struct x_display_info >> *dpyinfo, >> STORE_KEYSYM_FOR_DEBUG (copy_bufptr[i]); >> } >> - if (nbytes) >> + /* Mind that NBYTES can be set even if KEYSYM >> + represents a modifier key, but that no character >> + events should be sent in that case. */ >> + >> + if (nbytes && !is_modifier_key) >> { >> inev.ie.kind =3D MULTIBYTE_CHAR_KEYSTROKE_EVENT; >> inev.ie.arg =3D make_unibyte_string (copy_bufptr, >> nbytes); Please excuse my carelessness, I appear to have ommitted a chunk of the diff: diff --git a/src/xterm.c b/src/xterm.c index 6a1642ff56e..4b2da066694 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -23734,6 +23734,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, ptrdiff_t i; unsigned int old_state; struct xi_device_t *device, *source; + bool is_modifier_key; =20 coding =3D Qlatin_1; =20 @@ -24091,6 +24092,18 @@ handle_one_xevent (struct x_display_info *dpyinfo, goto xi_done_keysym; } =20 + is_modifier_key =3D (IsModifierKey (keysym) + /* The symbols from XK_ISO_Lock + to XK_ISO_Last_Group_Lock + don't have real modifiers but + should be treated similarly to + Mode_switch by Emacs. */ +#if defined XK_ISO_Lock && defined XK_ISO_Last_Group_Lock + || (XK_ISO_Lock <=3D keysym + && keysym <=3D XK_ISO_Last_Group_Lock) +#endif + ); + /* Random non-modifier sorts of keysyms. */ if (((keysym >=3D XK_BackSpace && keysym <=3D XK_Escape) || keysym =3D=3D XK_Delete @@ -24175,17 +24188,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, /* Any "vendor-specific" key is ok. */ || (keysym & (1 << 28)) || (keysym !=3D NoSymbol && nbytes =3D=3D 0)) - && ! (IsModifierKey (keysym) - /* The symbols from XK_ISO_Lock - to XK_ISO_Last_Group_Lock - don't have real modifiers but - should be treated similarly to - Mode_switch by Emacs. */ -#if defined XK_ISO_Lock && defined XK_ISO_Last_Group_Lock - || (XK_ISO_Lock <=3D keysym - && keysym <=3D XK_ISO_Last_Group_Lock) -#endif - )) + && !is_modifier_key) { STORE_KEYSYM_FOR_DEBUG (keysym); /* make_lispy_event will convert this to a symbolic @@ -24204,7 +24207,11 @@ handle_one_xevent (struct x_display_info *dpyinfo, STORE_KEYSYM_FOR_DEBUG (copy_bufptr[i]); } =20 - if (nbytes) + /* Mind that NBYTES can be set even if KEYSYM + represents a modifier key, but that no character + events should be sent in that case. */ + + if (nbytes && !is_modifier_key) { inev.ie.kind =3D MULTIBYTE_CHAR_KEYSTROKE_EVENT; inev.ie.arg =3D make_unibyte_string (copy_bufptr, nbytes);