Repository: godotengine/godot (language: cpp)

Issue:
[Linux] Numpad period key triggers delete instead of period
### Tested versions

Reproducible in 4.4.dev[d2995dcfe8fa8a81a9284f5fd4dab1c4cf8779ce].

### System information

Godot v4.4.beta.mono - EndeavourOS SMP PREEMPT_DYNAMIC Sat, 18 Jan 2025 02:26:57 +0000 on Wayland - X11 display driver, Multi-window, 1 monitor - Vulkan (Mobile) - integrated AMD Radeon Graphics (RADV RENOIR) - AMD Ryzen 7 4800U with Radeon Graphics (16 threads)

### Issue description

Since #102169, numpad period key triggers delete in script editor and triggers nothing in property inspector instead of period in Linux, but `Alt + Numpad Period` triggers period.

### Steps to reproduce

Press numpad period key in Godot script editor or property inspector.

### Minimal reproduction project (MRP)

N/A

*Bugsquad: bisected to https://github.com/godotengine/godot/commit/140a63be25cbcf0abdc363be3a3e52ea2bf05e9c*


Discussion / hints:
Can you reproduce this with native Wayland support enabled in the Editor Settings (**Prefer Wayland**)?

Also, double-check your numlock key status.
Whether numlock is on or off, it performs delete. And enable Prefer Wayland it's the same.
I found there was also this issue even before #102169 when enables native Wayland, but it doesn't happend when using X11. 
Bisected from https://github.com/godotengine/godot/commit/140a63be25cbcf0abdc363be3a3e52ea2bf05e9c, cc. @Riteo.

Fix patch:
diff --git a/platform/linuxbsd/wayland/key_mapping_xkb.cpp b/platform/linuxbsd/wayland/key_mapping_xkb.cpp
index 7d3a4272f5ad..04d8496c0838 100644
--- a/platform/linuxbsd/wayland/key_mapping_xkb.cpp
+++ b/platform/linuxbsd/wayland/key_mapping_xkb.cpp
@@ -371,11 +371,13 @@ void KeyMappingXKB::initialize() {
 
 bool KeyMappingXKB::is_sym_numpad(xkb_keysym_t p_keysym) {
 	switch (p_keysym) {
+		case XKB_KEY_KP_Equal:
+		case XKB_KEY_KP_Add:
+		case XKB_KEY_KP_Subtract:
 		case XKB_KEY_KP_Multiply:
 		case XKB_KEY_KP_Divide:
-		case XKB_KEY_KP_Subtract:
 		case XKB_KEY_KP_Separator:
-		case XKB_KEY_KP_Add:
+		case XKB_KEY_KP_Decimal:
 		case XKB_KEY_KP_0:
 		case XKB_KEY_KP_1:
 		case XKB_KEY_KP_2:
diff --git a/platform/linuxbsd/x11/key_mapping_x11.cpp b/platform/linuxbsd/x11/key_mapping_x11.cpp
index e6494985a4a2..8a138f4bb476 100644
--- a/platform/linuxbsd/x11/key_mapping_x11.cpp
+++ b/platform/linuxbsd/x11/key_mapping_x11.cpp
@@ -1131,11 +1131,13 @@ void KeyMappingX11::initialize() {
 
 bool KeyMappingX11::is_sym_numpad(KeySym p_keysym) {
 	switch (p_keysym) {
+		case XK_KP_Equal:
+		case XK_KP_Add:
+		case XK_KP_Subtract:
 		case XK_KP_Multiply:
 		case XK_KP_Divide:
-		case XK_KP_Subtract:
 		case XK_KP_Separator:
-		case XK_KP_Add:
+		case XK_KP_Decimal:
 		case XK_KP_0:
 		case XK_KP_1:
 		case XK_KP_2:


Test patch: