From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.help Subject: Re: numpad doesnt seem to send kp events in wayland Date: Wed, 23 Oct 2024 09:11:24 +0200 Message-ID: <87r087mgyr.fsf@tanaka.verona.se> References: <874j55qc5o.fsf@tanaka.verona.se> <86r087ol9n.fsf@aarsen.me> 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="2999"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: help-gnu-emacs@gnu.org To: Arsen =?utf-8?Q?Arsenovi=C4=87?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 23 09:12:14 2024 Return-path: Envelope-to: geh-help-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 1t3VXO-0000Y7-4F for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 23 Oct 2024 09:12:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3VWt-0004Oq-S7; Wed, 23 Oct 2024 03:11:39 -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 1t3VWr-0004Oh-HA for help-gnu-emacs@gnu.org; Wed, 23 Oct 2024 03:11:37 -0400 Original-Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3VWn-00056q-R4 for help-gnu-emacs@gnu.org; Wed, 23 Oct 2024 03:11:37 -0400 Original-Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id DA6A8DE9F3 for ; Wed, 23 Oct 2024 09:11:26 +0200 (CEST) Original-Received: from s934.loopia.se (unknown [172.22.191.6]) by s807.loopia.se (Postfix) with ESMTP id C1B90DF748; Wed, 23 Oct 2024 09:11:26 +0200 (CEST) Original-Received: from s470.loopia.se (unknown [172.22.191.6]) by s934.loopia.se (Postfix) with ESMTP id C046E7CEA49; Wed, 23 Oct 2024 09:11:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at amavis.loopia.se Authentication-Results: s470.loopia.se (amavisd-new); dkim=neutral reason="invalid (public key: not available)" header.d=verona.se Original-Received: from s980.loopia.se ([172.22.191.6]) by s470.loopia.se (s470.loopia.se [172.22.190.34]) (amavisd-new, port 10024) with UTF8LMTP id K4oqSonie49I; Wed, 23 Oct 2024 09:11:25 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: smtpuser@verona.se X-Loopia-Originating-IP: 193.234.148.196 Original-Received: from tanaka.verona.se (unknown [193.234.148.196]) (Authenticated sender: smtpuser@verona.se) by s980.loopia.se (Postfix) with ESMTPSA id 1B2D02201662; Wed, 23 Oct 2024 09:11:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verona.se; s=loopiadkim1720028670; t=1729667485; bh=FE0BQLS1PKgq41uVUkvc4qewfVf1DwM/rSg/olk/Q48=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=gMkeYRbqH4jnReyB9x8KH40g+fsgDLow8L+Yf6UreUzrJGeODDUqtMYtJDdOFJhM5 JF1bPu6XktYbSNkxQgoWMFu/mY7cY8rJxQxqDaVnVv04Cs/cOTi/Ytv2pAf0nGeB8S n2nfVNyzymZ+Mt58XZr/s6kKhrOhJimWl0X5Oe8AV6726gHCr/HTEdSSwndbEiujj3 DKq5bqrvDgzArddtlxrhK/H5jJqHZrOi1mg5HUf0lxxnMAVMC8xehKOTHgu04yFDW6 gxPGwkXzwajjJ7Ihpuv/YFQ/GEuX+XLtx+kq+rquQqHFcuSeSA/jiDMlN+HcAuc46I WlEqWlhtsHVAA== In-Reply-To: <86r087ol9n.fsf@aarsen.me> ("Arsen =?utf-8?Q?Arsenovi=C4=87?= =?utf-8?Q?=22's?= message of "Tue, 22 Oct 2024 23:55:32 +0200") Received-SPF: pass client-ip=93.188.3.37; envelope-from=joakim@verona.se; helo=smtp.outgoing.loopia.se X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1.697, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:148216 Archived-At: Arsen Arsenovi=C4=87 writes: > joakim@verona.se writes: > >> Hello, >> >> 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. >> >> for some reason i3 wont work anymore so I dont have anything to compare >> with. >> >> Is this just me or is this a well known problem? >> >> 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:eva= l ,(concat "(sylt.core/song-event \"" num "\")"))))) >> >> >> >> (sylt-song-event-map-key "" "init") >> (sylt-song-event-map-key "" "1") > > FWIW, you can try checking against https://git.sr.ht/~sircmpwn/wev and > WAYLAND_DEBUG=3D1 instead of xev to check whether there's matching > keycodes. > > I don't have a keypad to test with right now but I suspect something can > be arranged for your case. Consider (read-key) also as a test. Thanks for the reply! 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? I will need to compile some other type of emacs toolkit next I guess. --=20 Joakim Verona joakim@verona.se