Merge pull request #751 from psnszsn/main

apprt/gtk: handle non-ascii keyvals
This commit is contained in:
Mitchell Hashimoto
2023-10-28 08:43:33 -07:00
committed by GitHub

View File

@ -14,6 +14,7 @@ const CoreSurface = @import("../../Surface.zig");
const App = @import("App.zig"); const App = @import("App.zig");
const Window = @import("Window.zig"); const Window = @import("Window.zig");
const inspector = @import("inspector.zig"); const inspector = @import("inspector.zig");
const gtk_key = @import("key.zig");
const c = @import("c.zig"); const c = @import("c.zig");
const log = std.log.scoped(.gtk); 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; break :key physical_key;
} else .invalid; } else .invalid;