From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alexander =?UTF-8?Q?Pr=C3=A4hauser?= Newsgroups: gmane.emacs.bugs Subject: bug#65068: 29.1; xkb-interception interaction causes problems with key combinations Date: Thu, 24 Aug 2023 17:34:39 +0200 Message-ID: <875y54qwi8.fsf@gmx.at> 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> <874jko629m.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35386"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.10.5; emacs 30.0.50 Cc: 65068@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 24 15:41:08 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 1qZAaC-0008wi-Gk for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Aug 2023 15:41:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZAa5-0008Ks-Ju; Thu, 24 Aug 2023 09:41:01 -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 1qZAa2-0008Kh-Vd for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 09:40: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 1qZAa1-0006y0-RI for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 09:40:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZAa5-00066W-Ob for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 09:41:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alexander =?UTF-8?Q?Pr=C3=A4hauser?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Aug 2023 13:41:01 +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.169288444723436 (code B ref 65068); Thu, 24 Aug 2023 13:41:01 +0000 Original-Received: (at 65068) by debbugs.gnu.org; 24 Aug 2023 13:40:47 +0000 Original-Received: from localhost ([127.0.0.1]:36403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZAZq-00065w-EX for submit@debbugs.gnu.org; Thu, 24 Aug 2023 09:40:46 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:42905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZAZo-00065e-9g for 65068@debbugs.gnu.org; Thu, 24 Aug 2023 09:40:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.at; s=s31663417; t=1692884431; x=1693489231; i=alexander.praehauser@gmx.at; bh=GE0eUVUl0qyWIHIkC61s1JBWnLr6/aVkyipy9Ib5wZg=; h=X-UI-Sender-Class:References:From:To:Cc:Subject:Date:In-reply-to; b=O1odjfNFTJRdGkbmV7Wmpc8gkA82u2GO5fNv3fY+bQinocDHpNbMpWnCGXp4PqNui5b2gBI rqASUuKUN16TAtNlP8OsimfHVeB1VxTBdcP4vQ9tHEgRZNm2zY72RJ70LSijCSQb/gU7VDwV1 mObUkqvm2UImvCxIBVjkBQLatjaiNjDTvn5wmPdKSvl9/nkK5Sxd7M27Zml1f/dy9crVCKQ6l Bm1IBSAcEHGXYNp+fl5tMBlUVgRW7ZOJfoC9vCVTB0BCmZWodpVkXbYAG9uWQkE1Mzkalvsba ysbVw5QfFD4T7qDVxJtjTQVjMqSVNcPp3bQywEtRQPEBbkFObMpw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from Arch ([87.249.133.98]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M72oB-1qdobg1GG7-008dh0; Thu, 24 Aug 2023 15:40:31 +0200 In-reply-to: <874jko629m.fsf@yahoo.com> X-Provags-ID: V03:K1:uLYubcWPt7y0cvKrP1sDuvyKkQWksQaTQuAn8d90L6WRHKUnsfJ gJwEFBtKew/Nfat+1dV95sSizZiWSM5kWpV1FYZpmkoj56/bQySXQ4BWLXA1th77piL7S1b h/19RrGCfmcQM3Y4SDRfDccJuovjCv1n7GYsK6G17V31L+LvJIN+sPP0fENFJBLuvt+1uAP 8JOsye5vuXmjsDAMCmdlg== UI-OutboundReport: notjunk:1;M01:P0:tAsWNEzvV7s=;DGR9V0fFeaPU015FJ93pUbCAIVV 3RvSwNeDHyrrDu009wrNG2vzJ+Mj+rjnP6UORM8rsFGXUGNUUCMOM8YmaINqermU199yLTmPp Eqnx6/AznrZUKcouI1Yjt8/N8IHuUE2XWW/klH2kFS3u3+pWOL7e1PROMVvKhUYzriwK+DDxE oI8fqhByakIcPGIBt4MPs8jZVMH/1UjEYDBn/lmgbrG2aDQFjSExk2MqOfomjXlY1u93GxX56 E7jbC8dLz9LzO8ApDdhyHYIzdtA0P+g4ABwxCm1fRhDtwOgCiDNVxL5KJL4uUnY6CVTziggP0 pXRmlkdzvy03B4BjxNiWyVyMJEVis6vcijPZ9L7nwcnGMitD9la05csQJyUAvqYXAOd6Z3TBd pJevTnYPG4fBd9IUIu1ksp7kJv7QTxP79FuYsQI2v8BTDtGES7zRWvciW48G02V6TulWdAGxE 0nOOt2PZar1RuVoNyo8KMFgaM4ulmNcp2c4Aw8QfBILnveyqHx/IUo7YNLXpPtfwHD/+HU/Rt 8vVCneBAhgNgAh5sNdRWOLe79cwYihLiDSwBoN7iNTR81q9A6HrYN4uX5GTbMwJiobrvsBZXU PigpA+WhmJmH5ADvuvLvpYV7zRRf4RNVQ0Elb5u4hr72HhZbpCicadkvRiJu70UrQ3hLTiuUk wC7TyRsQD+lgIQs7jcUBeOIFwtcXRbla8VOGK7tSVRVwHeQmsEnoVeamtSxnCBTz+CslO6+TI Ep+PUJGpAV3e26Sou2s/nNEAMkR3rmsG+TKJBxMXMsN7ioqx8GvC5d0agaYWCGtWCKKr4yzs 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:268339 Archived-At: Now when I press for instance Space, it doesn't seem to evaluate=20 immediately, but it does evaluate when I press another dual-function-modified key. So if I press the same=20 sequence as below the first message doesn't appear but the second one does. Po Lu [2023-08-24 Thu 20:41] wrote: > Alexander Pr=C3=A4hauser writes: > >> It does seem to register the correct level shifts now, but it=20 >> seems to >> evaluate each key immediately after having been >> pressed. For instance, when I press Space-CapsLock-U, this=20 >> 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=20 >>>> 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=20 >>>> 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=20 >>> to. If >>> ISO_Level3_Shift is registered as a modifier key, it should=20 >>> not be >>> translated into keyboard input afterwards, let alone the=20 >>> original >>> apostrophe symbol. >>> >>> Does this patch resolve your problems with typing level 3=20 >>> 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=20 >>> 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=20 >>> 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=20 >>> 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=20 >>> 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=20 >>> character >>> + events should be sent in that case. */ >>> + >>> + if (nbytes && !is_modifier_key) >>> { >>> inev.ie.kind =3D=20 >>> MULTIBYTE_CHAR_KEYSTROKE_EVENT; >>> inev.ie.arg =3D make_unibyte_string=20 >>> (copy_bufptr, >>> nbytes); > > Please excuse my carelessness, I appear to have ommitted a chunk=20 > 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=20 > *dpyinfo, > ptrdiff_t i; > unsigned int old_state; > struct xi_device_t *device, *source; > + bool is_modifier_key; >=20=20 > coding =3D Qlatin_1; >=20=20 > @@ -24091,6 +24092,18 @@ handle_one_xevent (struct=20 > x_display_info *dpyinfo, > goto xi_done_keysym; > } >=20=20 > + is_modifier_key =3D (IsModifierKey (keysym) > + /* The symbols from=20 > XK_ISO_Lock > + to XK_ISO_Last_Group_Lock > + don't have real modifiers=20 > but > + should be treated=20 > similarly to > + Mode_switch by Emacs. */ > +#if defined XK_ISO_Lock && defined XK_ISO_Last_Group_Lock > + || (XK_ISO_Lock <=3D keysym > + && keysym <=3D=20 > XK_ISO_Last_Group_Lock) > +#endif > + ); > + > /* Random non-modifier sorts of keysyms. */ > if (((keysym >=3D XK_BackSpace && keysym <=3D=20 > XK_Escape) > || keysym =3D=3D XK_Delete > @@ -24175,17 +24188,7 @@ handle_one_xevent (struct=20 > 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=20 > XK_ISO_Last_Group_Lock) > -#endif > - )) > + && !is_modifier_key) > { > STORE_KEYSYM_FOR_DEBUG (keysym); > /* make_lispy_event will convert this to a=20 > symbolic > @@ -24204,7 +24207,11 @@ handle_one_xevent (struct=20 > x_display_info *dpyinfo, > STORE_KEYSYM_FOR_DEBUG (copy_bufptr[i]); > } >=20=20 > - if (nbytes) > + /* Mind that NBYTES can be set even if KEYSYM > + represents a modifier key, but that no=20 > character > + events should be sent in that case. */ > + > + if (nbytes && !is_modifier_key) > { > inev.ie.kind =3D=20 > MULTIBYTE_CHAR_KEYSTROKE_EVENT; > inev.ie.arg =3D make_unibyte_string=20 > (copy_bufptr, nbytes);