Skip to content

Commit

Permalink
Merge pull request #751 from psnszsn/main
Browse files Browse the repository at this point in the history
apprt/gtk: handle non-ascii keyvals
  • Loading branch information
mitchellh authored Oct 28, 2023
2 parents 4589883 + c2adf22 commit 533b28e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/apprt/gtk/Surface.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 533b28e

Please sign in to comment.