From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#74016: 29.4; emacs-pgtk doesnt receive numpad events on wayland(sway) Date: Sat, 02 Nov 2024 13:29:18 +0200 Message-ID: <86a5ehzxf5.fsf@gnu.org> References: <87zfmsx9ez.fsf@chopper> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23316"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74016@debbugs.gnu.org To: joakim@verona.se, Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 02 12:30:22 2024 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 1t7CKj-0005ui-RX for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Nov 2024 12:30:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7CKV-0001MS-JL; Sat, 02 Nov 2024 07:30:07 -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 1t7CKR-0001Je-GT for bug-gnu-emacs@gnu.org; Sat, 02 Nov 2024 07:30:04 -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 1t7CKQ-0001nQ-PW for bug-gnu-emacs@gnu.org; Sat, 02 Nov 2024 07:30:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=c7yFDif8IW6w8RZuciNLU5LyP2Av/HlgtGYOK9IxZFs=; b=gPZQS7pJ5po/dv+EC0zPTPZoHwM5CW3iFst5JIlAVuMSUDkcPzpkfZRC3Kzbl8yvqus9/14NILFlic93Eq9VpWlHV59uTHut4Pj27Vhw9KuIze0sgCgY8goYudX7I0S0SOnI3/hA7oPaGeveWOG2mWnF8d8SzXBsnD7glZe8UP8hMJD5qDZBD7zLMc4SOkTinJTl+ovBI9cPBxVXJMA5u421oEiwWoBkv0c1D5ffCykqm1QDEiiI/df3bBEDS2QSoCK1Y478rFCdtmfhE112Hr/V8PIZN64aks5CipYyAnyZi25FKJ0yjZvd3o92zn2gzQj+yEJ6iOS/Tw6vLiVs7A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t7CKQ-0007md-Dt for bug-gnu-emacs@gnu.org; Sat, 02 Nov 2024 07:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Nov 2024 11:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74016 X-GNU-PR-Package: emacs Original-Received: via spool by 74016-submit@debbugs.gnu.org id=B74016.173054697729884 (code B ref 74016); Sat, 02 Nov 2024 11:30:02 +0000 Original-Received: (at 74016) by debbugs.gnu.org; 2 Nov 2024 11:29:37 +0000 Original-Received: from localhost ([127.0.0.1]:53318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t7CK1-0007lv-1a for submit@debbugs.gnu.org; Sat, 02 Nov 2024 07:29:37 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:38646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t7CJy-0007lk-Iq for 74016@debbugs.gnu.org; Sat, 02 Nov 2024 07:29:35 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t7CJt-0001cR-6a; Sat, 02 Nov 2024 07:29:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=c7yFDif8IW6w8RZuciNLU5LyP2Av/HlgtGYOK9IxZFs=; b=NMDHmZzF8JZ6 4NCxK26sD86y/21sykOk4o7rAbeYqUvk4UN/oyJUzKAJEckJsqdiNraWiJ6lSQSAPtWmr0ri7qaZ/ jcGztWu51Pzx/DQTNVGU4lZ3B1LgFF4HawBhCeOGTCQFs8rRWkFzFHKfCpwPwUXgeU4f/IZKtEGNr 5923doxDASPznVw6sAQ7DyKeJJosyNVyyxZ4PWLWTwlDqy+EimMCndi5tIwJLHhw/CKM0eXQTg847 F6Ampp0XidnlAqQo/el428urv9jkXg3I5I4wAT3KAkXDyyD0YmUDIiAyZ47m/czVis83OsFTit6XQ vm8mciTuS7GAiPIZIvCCwQ==; In-Reply-To: <87zfmsx9ez.fsf@chopper> (joakim@verona.se) 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:294732 Archived-At: > From: joakim@verona.se > Date: Fri, 25 Oct 2024 21:35:48 +0200 > > > Emacs-pgtk doesnt seem to receive numpad events, instead number events > are received. > > There was a thread about this on emacs-help: > > https://lists.gnu.org/archive/html/help-gnu-emacs/2024-10/msg00094.html > > I have attempted to summarize the thread here, wherein Stefan Monier > recomended I report this as a bug, and I also received knowledgeable > advice from several others. > > Heres the bug: > > I used to use a numpad to bind to do things in emacs. > > This used to work really well on the i3wm window manager and a gtk emacs > build. > > Then I bought a nice new framework laptop which has a hidpi screen, so I > switched to using the sway wm, and emacs-pgtk. > > Now the numpad no longer sends keypad events in a way that emacs > recognizes, instead just plain numbers are received. > > below is an example of the code I use, but normally I just test with c-h > k to see which key emacs receives. > > I also tried xev, and there it seems I get kp events, at least under > xwayland I guess. > > (define-key cider-mode-map (kbd "") 'sylt-stop) > (define-key cider-mode-map (kbd "") 'sylt-play-metro) > > (defmacro sylt-song-event-map-key (key num) > `(define-key cider-mode-map (kbd ,key) > (lambda () (interactive) (cider-nrepl-sync-request:eval > ,(concat "(sylt.core/song-event \"" num "\")"))))) > > > > (sylt-song-event-map-key "" "init") > (sylt-song-event-map-key "" "1") > > > Instead of xev, I tried wev, and got this, which seems expected: > > Using wev, installed from Fedora repos I get, for numpad 4, and normal 4: > > [14: wl_keyboard] key: serial: 60293; time: 61646320; key: 83; state: 0 > (released) > sym: KP_4 (65460), utf8: '' > [14: wl_keyboard] key: serial: 60294; time: 61651642; key: 13; state: 1 > (pressed) > sym: 4 (52), utf8: '4' > > That is, the numpad and the number pad sends distinct events that are > received by wev. > > using (read-key) in emacs-pgtk, both the numpad and the number row are > received as the same event: > > 52 (#o64, #x34, ?4) [2 times] > > I get the same in a emacs gtk session. > > Maybe gtk is doing something weird? > > so now I tried emacs-29.4-gtk+x11 -Q > > and then I get "4 (translated from )" > on c-h k, numpad 4, so xwayland is doing something correctly in this > case, which pgtk isnt doing in the same way(imho incorrectly but what do > I know) > > (and as a reminder, I run emacs-pgtk because it looks super nice on > wayland, with the scaling hints I use on my framework hidpi screen, but > emacs-29.4-gtk+x11 doesnt look good.) Po Lu, is this another manifestation of problems with keyboard input under PGTK? If so, should we add something to etc/PROBLEMS?