mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
apprt/gtk: accelerator with unicode codepoint can use it directly
This commit is contained in:
@ -14,11 +14,14 @@ pub fn accelFromTrigger(buf: []u8, trigger: input.Binding.Trigger) !?[:0]const u
|
|||||||
if (trigger.mods.super) try writer.writeAll("<Super>");
|
if (trigger.mods.super) try writer.writeAll("<Super>");
|
||||||
|
|
||||||
// Write our key
|
// Write our key
|
||||||
const keyval = switch (trigger.key) {
|
switch (trigger.key) {
|
||||||
.physical, .translated => |k| keyvalFromKey(k) orelse return null,
|
.physical, .translated => |k| {
|
||||||
.unicode => return null,
|
const keyval = keyvalFromKey(k) orelse return null;
|
||||||
};
|
try writer.writeAll(std.mem.sliceTo(c.gdk_keyval_name(keyval), 0));
|
||||||
try writer.writeAll(std.mem.sliceTo(c.gdk_keyval_name(keyval), 0));
|
},
|
||||||
|
|
||||||
|
.unicode => |cp| try writer.print("{u}", .{cp}),
|
||||||
|
}
|
||||||
|
|
||||||
// We need to make the string null terminated.
|
// We need to make the string null terminated.
|
||||||
try writer.writeByte(0);
|
try writer.writeByte(0);
|
||||||
|
Reference in New Issue
Block a user