* bug#74016: 29.4; emacs-pgtk doesnt receive numpad events on wayland(sway)
@ 2024-10-25 19:35 joakim
2024-11-02 11:29 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: joakim @ 2024-10-25 19:35 UTC (permalink / raw)
To: 74016
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 "<kp-enter>") 'sylt-stop)
(define-key cider-mode-map (kbd "<kp-separator>") '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 "<kp-0>" "init")
(sylt-song-event-map-key "<kp-1>" "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 <kp-4>)"
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.)
/Joakim
In GNU Emacs 29.4 (build 1, x86_64-redhat-linux-gnu, GTK+ Version
3.24.43, cairo version 1.18.0) of 2024-10-10 built on
4825182c94fc4195b65c80c30f523a16
System Description: Fedora Linux 41 (Workstation Edition)
Configured using:
'configure --build=x86_64-redhat-linux-gnu
--host=x86_64-redhat-linux-gnu --program-prefix=
--disable-dependency-tracking --prefix=/usr --exec-prefix=/usr
--bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
--datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
--libexecdir=/usr/libexec --localstatedir=/var --runstatedir=/run
--sharedstatedir=/var/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-cairo --with-dbus --with-gif
--with-gpm=no --with-harfbuzz --with-jpeg --with-json --with-modules
--with-native-compilation=aot --with-pgtk --with-png --with-rsvg
--with-sqlite3 --with-tiff --with-tree-sitter --with-webp --with-xpm
build_alias=x86_64-redhat-linux-gnu host_alias=x86_64-redhat-linux-gnu
CC=gcc 'CFLAGS=-DMAIL_USE_LOCKF -O2 -flto=auto -ffat-lto-objects
-fexceptions -g -grecord-gcc-switches -pipe -Wall
-Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3
-Wp,-D_GLIBCXX_ASSERTIONS
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64
-mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection
-fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer
-mno-omit-leaf-frame-pointer ' 'LDFLAGS=-Wl,-z,relro -Wl,--as-needed
-Wl,-z,pack-relative-relocs -Wl,-z,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1
-specs=/usr/lib/rpm/redhat/redhat-package-notes '
PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig CXX=g++
'CXXFLAGS=-O2 -flto=auto -ffat-lto-objects -fexceptions -g
-grecord-gcc-switches -pipe -Wall -Werror=format-security
-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64
-mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection
-fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer
-mno-omit-leaf-frame-pointer ''
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY
PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: Shell
Minor modes in effect:
org-super-agenda-mode: t
detached-shell-mode: t
which-key-mode: t
recentf-mode: t
desktop-save-mode: t
keyfreq-autosave-mode: t
keyfreq-mode: t
winner-mode: t
projectile-mode: t
smartparens-global-strict-mode: t
smartparens-strict-mode: t
smartparens-mode: t
global-highlight-parentheses-mode: t
highlight-parentheses-mode: t
company-quickhelp-mode: t
company-quickhelp-local-mode: t
global-company-mode: t
company-mode: t
shx-global-mode: t
shx-mode: t
erc-stamp-mode: t
diredfl-global-mode: t
zen-reward-mode: t
repeat-mode: t
magit-gptcommit-mode: t
magit-auto-revert-mode: t
global-git-commit-mode: t
server-mode: t
selected-window-accent-mode: t
gcmh-mode: t
global-treesit-auto-mode: t
savehist-mode: t
vertico-mode: t
marginalia-mode: t
shell-dirtrack-mode: t
async-bytecomp-package-mode: t
override-global-mode: t
yas-global-mode: t
yas-minor-mode: t
comint-fontify-input-mode: t
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
global-prettify-symbols-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
line-number-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
abbrev-mode: t
Load-path shadows:
/home/joakim/.emacs.d/elpa/transient-20241008.1824/transient hides /usr/share/emacs/29.4/lisp/transient
/home/joakim/.emacs.d/elpa/use-package-ensure-system-package-20221209.2013/use-package-ensure-system-package hides /usr/share/emacs/29.4/lisp/use-package/use-package-ensure-system-package
Features:
(shadow emacsbug mailalias smtpmail textsec uni-scripts idna-mapping
ucs-normalize uni-confusable textsec-check bbdb-com mail-extr gnus-msg
woman man pcmpl-x pcmpl-gnu hippie-exp cl-print debug backtrace cus-edit
cus-start cus-load mm-archive package-vc network-stream url-cache
display-line-numbers novice shortdoc help-fns radix-tree org-datetree
tabify org-capture detached-compile misearch multi-isearch org-clock
org-ql-search org-ql-view ov diary-lib diary-loaddefs cal-iso
org-super-agenda ht inline origami origami-parsers cal-move pcmpl-rpm
pcmpl-unix detached-shell detached notifications smartparens-latex
tex-mode css-mode java-ts-mode markdown-mode yaml-ts-mode
smartparens-javascript js c-ts-common smartparens-c cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid rng-loc rng-uri
rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns
nxml-mode nxml-outln nxml-rap smartparens-html sgml-mode nxml-util
nxml-enc xmltok mule-util generic make-mode flymake-kondor
smartparens-clojure cider cider-debug cider-browse-ns cider-mode
cider-xref-backend cider-find cider-inspector cider-completion
cider-profile cider-eval cider-jar arc-mode archive-mode
cider-repl-history pulse cider-repl cider-resolve cider-test
cider-overlays cider-stacktrace cider-doc cider-browse-spec
cider-clojuredocs cider-eldoc cider-docstring cider-client cider-common
cider-completion-context cider-connection cider-popup sesman-browser
nrepl-client cider-util sesman vc queue nrepl-dict spinner parseedn
parseclj-parser parseclj-lex parseclj-alist clojure-mode hl-line
gnus-dired vc-git vc-dispatcher combobulate combobulate-json
combobulate-yaml combobulate-css combobulate-js-ts combobulate-python
combobulate-html combobulate-query scheme combobulate-ui
combobulate-display combobulate-ztree combobulate-contrib
combobulate-envelope combobulate-manipulation combobulate-procedure
combobulate-navigation combobulate-misc combobulate-interface
combobulate-rules combobulate-settings tempo json-ts-mode
company-oddmuse company-keywords company-etags etags fileloop
company-gtags company-dabbrev-code company-dabbrev company-files
company-clang company-capf company-cmake company-semantic
company-template company-bbdb conf-mode org-ai org-ai-oobabooga
org-ai-sd org-ai-talk org-ai-on-project org-ai-useful
org-ai-openai-image org-ai-openai org-ai-block oc-basic ol-eww eww
url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect
gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig ol-docview
doc-view jka-compr ol-bibtex bibtex ol-bbdb ol-w3m ol-doi org-link-doi
init which-key spray face-remap wgrep memory-usage tramp-sh
jupyter-tramp tramp-cache time-stamp jupyter-server
jupyter-server-kernel jupyter-repl jupyter-widget-client simple-httpd
jupyter-client jupyter-kernel jupyter-kernelspec jupyter-env
jupyter-monads jupyter-messages hmac-def jupyter-mime jupyter-rest-api
websocket bindat jupyter-base eieio-base recentf tree-widget desktop
frameset keyfreq zygospore winner ace-window avy restclient nginx-mode
yaml-mode dockerfile-mode sh-script smie executable geiser hy-mode
hy-jedhy hy-shell hy-font-lock hy-base autodisass-java-bytecode
ad-javap-mode meghanada projectile ibuf-ext ibuffer ibuffer-loaddefs
smartparens-config smartparens-rst smartparens-markdown smartparens-org
smartparens-text smartparens-python smartparens-ess smartparens loadhist
highlight-parentheses company-quickhelp pos-tip company shx
bash-completion ob-cypher n4js cypher-mode cmake-mode rst
use-package-ensure-system-package use-package use-package-delight
use-package-diminish system-packages printing ps-print ps-print-loaddefs
lpr gnus-alias nnmairix nnml gnus-sum shr pixel-fill kinsoku url-file
svg dom gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud nnimap
nnmail mail-source utf7 gnus-spec gnus-int gnus-range gnus-win gnus nnoo
nnheader range sort bbdb bbdb-site timezone erc-match erc-ezbounce
erc-hl-nicks erc-button erc-fill erc-stamp erc-goodies erc erc-backend
erc-networks erc-common erc-compat erc-loaddefs pastebin secrets dbus
xml diredfl popup sauron disp-table emms-setup emms emms-compat
casual-dired casual-dired-settings dired-aux casual-dired-version
casual-dired-sort-by casual-dired-utils casual-dired-variables elint
checkdoc casual-lib casual-lib-version image-dired image-dired-tags
image-dired-external image-dired-util image-mode exif wdired dired-x
repeat llm-openai llm-provider-utils llm-models llm-request-plz url-http
url-auth url-gw nsm plz-event-source plz-media-type plz magit-gptcommit
llm magit-bookmark magit-submodule magit-blame magit-stash magit-reflog
magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote
magit-commit magit-sequence magit-notes magit-worktree magit-tag
magit-merge magit-branch magit-reset magit-files magit-refs magit-status
magit magit-repos magit-apply magit-wip magit-log which-func imenu
magit-diff smerge-mode diff diff-mode magit-core magit-autorevert
magit-margin magit-transient magit-process git-commit with-editor server
log-edit message sendmail yank-media puny rfc822 mml mml-sec epa epg
rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev
mail-utils gmm-utils mailheader pcvs-util add-log magit-mode benchmark
magit-git magit-base magit-section cursor-sensor crm
selected-window-accent-mode dired-quick-sort hydra lv ls-lisp pdfgrep
grep syncthing syncthing-update syncthing-watcher syncthing-network
syncthing-errors syncthing-keyboard syncthing-draw let-alist
syncthing-faces syncthing-common syncthing-state syncthing-constants
wid-edit syncthing-custom syncthing-groups autorevert filenotify gcmh ag
vc-svn find-dired dired dired-loaddefs csound-mode csound-manual-lookup
csound-skeleton autoinsert csound-indentation csound-repl highlight
facemenu csound-repl-interaction shut-up multi csound-score
csound-font-lock csound-eldoc csound-util csound-opcodes transient
treesit-auto orderless savehist vertico marginalia consult bookmark pp
detached-init modus-operandi-theme modus-themes highlight-indent-guides
ada-mode wisi-process-parse align ada-skel wisi-skel skeleton
ada-indent-user-options ada-core uniquify-files gnat-compiler wisi-prj
wisi wisi-fringe wisi-parse-common semantic/lex semantic/fw mode-local
find-file ob-shell ob-python python treesit ob-julia ob-ess-julia
ess-julia julia-mode julia-mode-latexsubs ess-r-mode ess-r-flymake
ess-r-xref xref ess-trns ess-r-package ess-r-completion ess-roxy
ess-r-syntax ess-rd hideshow ess-s-lang ess-help ess-mode ess-inf
ess-tracebug derived ess lisp-mnt ess-utils ess-custom tramp
tramp-loaddefs trampver tramp-integration files-x tramp-compat shell
parse-time iso8601 flymake-proc flymake project compile
text-property-search thingatpt helm-org-rifle helm helm-global-bindings
helm-core async-bytecomp helm-source helm-multi-match helm-lib async f
ob-gnuplot ob-plantuml ob-dot general org-ql ts compat compat-30
org-duration peg org-habit org-agenda org-element org-persist xdg org-id
avl-tree generator org-refile kurecolor dash s color edmacro kmacro
use-package-bind-key bind-key yasnippet-snippets yasnippet outshine
advice outshine-org-cmds outorg easy-mmode org ob ob-tangle ob-ref
ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete
org-list org-footnote org-faces org-entities time-date ob-emacs-lisp
ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys
oc org-loaddefs find-func cal-menu calendar cal-loaddefs org-version
org-compat org-macs format-spec noutline outline cl flyspell ispell
finder-inf boxquote rect use-package-ensure use-package-core comp
comp-cstr warnings icons cl-extra help-mode pcomplete comint ansi-osc
ansi-color ring generic-x lfe-start ace-window-autoloads
ada-mode-autoloads ag-autoloads autodisass-java-bytecode-autoloads
avy-autoloads bash-completion-autoloads bbdb-autoloads
boxquote-autoloads calfw-autoloads calfw-org-autoloads
casual-dired-autoloads casual-lib-autoloads cider-autoloads
clojure-mode-autoloads cmake-mode-autoloads combobulate-autoloads
company-quickhelp-autoloads csound-mode-autoloads detached-autoloads
dired-quick-sort-autoloads diredfl-autoloads dockerfile-mode-autoloads
editorconfig-autoloads embark-consult-autoloads consult-autoloads
embark-autoloads emms-autoloads erc-hl-nicks-autoloads
expand-region-autoloads flymake-kondor-autoloads gcmh-autoloads
geiser-autoloads general-autoloads gnat-compiler-autoloads
gnus-alias-autoloads go-mode-autoloads groovy-mode-autoloads
haskell-mode-autoloads helm-org-autoloads helm-easymenu
helm-org-rifle-autoloads helm-autoloads helm-core-autoloads
async-autoloads helpful-autoloads elisp-refs-autoloads
highlight-autoloads highlight-indent-guides-autoloads
highlight-parentheses-autoloads hy-mode-autoloads hydra-autoloads
ivy-yasnippet-autoloads ivy-autoloads js2-mode-autoloads
jupyter-autoloads keyfreq-autoloads kotlin-mode-autoloads
kurecolor-autoloads lua-mode-autoloads lv-autoloads
magit-gptcommit-autoloads llm-autoloads magit-autoloads pcase
marginalia-autoloads markdown-mode-autoloads meghanada-autoloads
flycheck-autoloads company-autoloads memory-usage-autoloads
multi-autoloads multitran-autoloads n4js-autoloads nginx-mode-autoloads
ob-cypher-autoloads dash-functional-autoloads cypher-mode-autoloads
ob-ess-julia-autoloads julia-mode-autoloads ess-autoloads
orderless-autoloads org-ai-autoloads org-ql-autoloads f-autoloads
org-roam-autoloads magit-section-autoloads emacsql-autoloads
org-super-agenda-autoloads ht-autoloads origami-autoloads
outshine-autoloads outorg-autoloads ov-autoloads ox-hugo-autoloads
ox-reveal-autoloads parseedn-autoloads parseclj-autoloads
pastebin-autoloads pdfgrep-autoloads peg-autoloads
plz-event-source-autoloads plz-media-type-autoloads plz-autoloads
popup-autoloads pos-tip-autoloads projectile-autoloads
protobuf-mode-autoloads queue-autoloads restclient-autoloads
rust-mode-autoloads sauron-autoloads
selected-window-accent-mode-autoloads sesman-autoloads shut-up-autoloads
shx-autoloads simple-httpd-autoloads smartparens-autoloads
spinner-autoloads spray-autoloads syncthing-autoloads tomelr-autoloads
transient-autoloads transient-showcase-autoloads treesit-auto-autoloads
ts-autoloads s-autoloads dash-autoloads tuareg-autoloads rx
caml-autoloads uniquify-files-autoloads
use-package-ensure-system-package-autoloads system-packages-autoloads
vertico-autoloads webpaste-autoloads request-autoloads
websocket-autoloads wfnames-autoloads wgrep-autoloads
which-key-autoloads wiki-summary-autoloads wisi-autoloads
with-editor-autoloads info compat-autoloads yaml-mode-autoloads
yasnippet-snippets-autoloads yasnippet-autoloads zmq-autoloads
zygospore-autoloads package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie generate-lisp-file
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv
bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip
cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq
simple cl-generic indonesian philippine cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads dbusbind
inotify dynamic-setting system-font-setting font-render-setting cairo
gtk pgtk multi-tty make-network-process native-compile emacs)
Memory information:
((conses 16 5823950 2655728)
(symbols 48 92050 42)
(strings 32 704340 353349)
(string-bytes 1 23613416)
(vectors 16 218114)
(vector-slots 8 4567806 3485723)
(floats 8 1718 5313)
(intervals 56 324283 252876)
(buffers 984 387))
--
Joakim Verona
joakim@verona.se
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#74016: 29.4; emacs-pgtk doesnt receive numpad events on wayland(sway)
2024-10-25 19:35 bug#74016: 29.4; emacs-pgtk doesnt receive numpad events on wayland(sway) joakim
@ 2024-11-02 11:29 ` Eli Zaretskii
2024-11-02 13:34 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-03 9:02 ` joakim
0 siblings, 2 replies; 7+ messages in thread
From: Eli Zaretskii @ 2024-11-02 11:29 UTC (permalink / raw)
To: joakim, Po Lu; +Cc: 74016
> 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 "<kp-enter>") 'sylt-stop)
> (define-key cider-mode-map (kbd "<kp-separator>") '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 "<kp-0>" "init")
> (sylt-song-event-map-key "<kp-1>" "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 <kp-4>)"
> 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?
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#74016: 29.4; emacs-pgtk doesnt receive numpad events on wayland(sway)
2024-11-02 11:29 ` Eli Zaretskii
@ 2024-11-02 13:34 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-16 13:45 ` Eli Zaretskii
2024-11-03 9:02 ` joakim
1 sibling, 1 reply; 7+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-02 13:34 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 74016, joakim
Eli Zaretskii <eliz@gnu.org> writes:
> Po Lu, is this another manifestation of problems with keyboard input
> under PGTK? If so, should we add something to etc/PROBLEMS?
I'm not sure. I will try to establish whether it is.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#74016: 29.4; emacs-pgtk doesnt receive numpad events on wayland(sway)
2024-11-02 11:29 ` Eli Zaretskii
2024-11-02 13:34 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-11-03 9:02 ` joakim
1 sibling, 0 replies; 7+ messages in thread
From: joakim @ 2024-11-03 9:02 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Po Lu, 74016
Eli Zaretskii <eliz@gnu.org> writes:
>> 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 "<kp-enter>") 'sylt-stop)
>> (define-key cider-mode-map (kbd "<kp-separator>") '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 "<kp-0>" "init")
>> (sylt-song-event-map-key "<kp-1>" "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 <kp-4>)"
>> 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?
FYI I found a "workaround" to this problem. I now run Sway with scaling of
1 rather than 1.25.
Then I have to scale each application independently, so I set the
corresponding scale factor in sway window decorations, waybar, firefox
etc.
(the problem with this aproach is that a number of x11 apps cant be scaled)
Lastly in emacs I just scale the fonts and run emacs-gtk-x11. Now things
work adequately.
emacs-pgtk has other interesting features, but I guess they will have to
wait a while more.
Thanks everyone!
>
>
>
--
Joakim Verona
joakim@verona.se
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#74016: 29.4; emacs-pgtk doesnt receive numpad events on wayland(sway)
2024-11-02 13:34 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-11-16 13:45 ` Eli Zaretskii
2024-11-30 9:53 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2024-11-16 13:45 UTC (permalink / raw)
To: Po Lu; +Cc: 74016, joakim
> From: Po Lu <luangruo@yahoo.com>
> Cc: joakim@verona.se, 74016@debbugs.gnu.org
> Date: Sat, 02 Nov 2024 21:34:31 +0800
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > Po Lu, is this another manifestation of problems with keyboard input
> > under PGTK? If so, should we add something to etc/PROBLEMS?
>
> I'm not sure. I will try to establish whether it is.
Any progress here?
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#74016: 29.4; emacs-pgtk doesnt receive numpad events on wayland(sway)
2024-11-16 13:45 ` Eli Zaretskii
@ 2024-11-30 9:53 ` Eli Zaretskii
2024-12-14 9:35 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2024-11-30 9:53 UTC (permalink / raw)
To: luangruo; +Cc: 74016, joakim
Ping!
> Cc: 74016@debbugs.gnu.org, joakim@verona.se
> Date: Sat, 16 Nov 2024 15:45:58 +0200
> From: Eli Zaretskii <eliz@gnu.org>
>
> > From: Po Lu <luangruo@yahoo.com>
> > Cc: joakim@verona.se, 74016@debbugs.gnu.org
> > Date: Sat, 02 Nov 2024 21:34:31 +0800
> >
> > Eli Zaretskii <eliz@gnu.org> writes:
> >
> > > Po Lu, is this another manifestation of problems with keyboard input
> > > under PGTK? If so, should we add something to etc/PROBLEMS?
> >
> > I'm not sure. I will try to establish whether it is.
>
> Any progress here?
>
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#74016: 29.4; emacs-pgtk doesnt receive numpad events on wayland(sway)
2024-11-30 9:53 ` Eli Zaretskii
@ 2024-12-14 9:35 ` Eli Zaretskii
0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2024-12-14 9:35 UTC (permalink / raw)
To: luangruo; +Cc: 74016, joakim
Ping! Ping!
> Cc: 74016@debbugs.gnu.org, joakim@verona.se
> Date: Sat, 30 Nov 2024 11:53:35 +0200
> From: Eli Zaretskii <eliz@gnu.org>
>
> Ping!
>
> > Cc: 74016@debbugs.gnu.org, joakim@verona.se
> > Date: Sat, 16 Nov 2024 15:45:58 +0200
> > From: Eli Zaretskii <eliz@gnu.org>
> >
> > > From: Po Lu <luangruo@yahoo.com>
> > > Cc: joakim@verona.se, 74016@debbugs.gnu.org
> > > Date: Sat, 02 Nov 2024 21:34:31 +0800
> > >
> > > Eli Zaretskii <eliz@gnu.org> writes:
> > >
> > > > Po Lu, is this another manifestation of problems with keyboard input
> > > > under PGTK? If so, should we add something to etc/PROBLEMS?
> > >
> > > I'm not sure. I will try to establish whether it is.
> >
> > Any progress here?
> >
> >
> >
> >
>
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-12-14 9:35 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-25 19:35 bug#74016: 29.4; emacs-pgtk doesnt receive numpad events on wayland(sway) joakim
2024-11-02 11:29 ` Eli Zaretskii
2024-11-02 13:34 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-16 13:45 ` Eli Zaretskii
2024-11-30 9:53 ` Eli Zaretskii
2024-12-14 9:35 ` Eli Zaretskii
2024-11-03 9:02 ` joakim
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.