Emacs 29 on Fedora 40 does not recognize alt keypad (kp-divide, kp-multiply, kp-add, kp-subtract)

The kp-divide, kp-multiply, kp-add, kp-subtract no longer are mapped correctly on F40 plus Emacs 29.

I have been using the same Emacs init.el file (with minor mods) for over 30 years to map the F keys and alternate keypad to usable functions (Sun, Linux, UNIX, etc.). I just updated to Fedora 40 which includes Emacs 29, and most still function correctly (f keys, kp-enter), however a few of these are now broken: kp-divide, kp-multiply, kp-add, kp-subtract.

My mappings are:

(global-set-key [kp-divide] 'kill-current-line)
(global-set-key [kp-multiply] 'advertised-undo) ; LINUX
(global-set-key [kp-add] 'copy-region-as-kill) ; keypad +
(global-set-key [kp-subtract] 'kill-region) ; keypad -
(global-set-key [kp-enter] 'set-mark-command) ; keypad ENTER ← WORKS!

The kp-enter, insert, home, end, f1, f2, etc. key all are still mapped correctly and work. Note, my old init.el file has lines like:

(global-set-key [f1] 'delete-other-windows)

I did find out that Emacs 29 has changed the API, but the legacy global-set-key should still work.

Is this a mapping problem with Gnome? I tried several changes in gnome-tweaks
keyboard → Additional Layout Options
layout of the numeric keypad
default
legacy

Thanks for the help in advance!

See #51002 - 28.0.50; [feature/pgtk] Some keypad keys handled as normal keys with pgtk - GNU bug report logs for details but basically with the native GTK support the input method manages to convert some of the keypad symbols to the standard ones and the only known fix at the moment is to disable the input method support in emacs.

Note that the method given in the bug only works after pgtk has made a connection so if you want to do it in .emacs then it it better to do:

(setq pgtk-use-im-context-on-new-connection nil)

The downside of doing this is that compose key sequences won’t work in emacs along with any other input method based features you may be using.

I was actually just looking at the ibus source code when I saw your post to see if I could get to the bottom of this and so far I’m looking at ibus/src/ibuskeyuni.c at 4059b9f43f4505c855677abde1b59fc13241ca58 · ibus/ibus · GitHub which seems to map most of the keypad keys (but not the cursor movement keys) to the underlying character.