diff --git a/src/apprt/gtk/Surface.zig b/src/apprt/gtk/Surface.zig index 054c736e5d..60296d7e8d 100644 --- a/src/apprt/gtk/Surface.zig +++ b/src/apprt/gtk/Surface.zig @@ -14,6 +14,7 @@ const CoreSurface = @import("../../Surface.zig"); const App = @import("App.zig"); const Window = @import("Window.zig"); const inspector = @import("inspector.zig"); +const gtk_key = @import("key.zig"); const c = @import("c.zig"); const log = std.log.scoped(.gtk); @@ -905,6 +906,12 @@ fn keyEvent( } } + // Before using the physical key, try to convert the keyval + // directly to a key. This allows the use of key remapping. + if (gtk_key.keyFromKeyval(keyval)) |key| { + break :key key; + } + break :key physical_key; } else .invalid;