mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
input: rename Keymap to KeymapDarwin since its macos only for now
This commit is contained in:
@ -8,9 +8,10 @@ pub const Binding = @import("input/Binding.zig");
|
|||||||
pub const SplitDirection = Binding.Action.SplitDirection;
|
pub const SplitDirection = Binding.Action.SplitDirection;
|
||||||
pub const SplitFocusDirection = Binding.Action.SplitFocusDirection;
|
pub const SplitFocusDirection = Binding.Action.SplitFocusDirection;
|
||||||
|
|
||||||
// Keymap is only available on macOS right now
|
// Keymap is only available on macOS right now. We could implement it
|
||||||
|
// in theory for XKB too on Linux but we don't need it right now.
|
||||||
pub const Keymap = switch (builtin.os.tag) {
|
pub const Keymap = switch (builtin.os.tag) {
|
||||||
.macos => @import("input/Keymap.zig"),
|
.macos => @import("input/KeymapDarwin.zig"),
|
||||||
else => struct {},
|
else => struct {},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -212,23 +212,26 @@ test {
|
|||||||
var keymap = try init();
|
var keymap = try init();
|
||||||
defer keymap.deinit();
|
defer keymap.deinit();
|
||||||
|
|
||||||
// Single quote ' which is fine on US, but dead on US-International
|
// These tests are all commented because they depend on the user-selected
|
||||||
var buf: [4]u8 = undefined;
|
// keyboard layout...
|
||||||
var state: State = .{};
|
//
|
||||||
{
|
// // Single quote ' which is fine on US, but dead on US-International
|
||||||
const result = try keymap.translate(&buf, &state, 0x27, .{});
|
// var buf: [4]u8 = undefined;
|
||||||
std.log.warn("map: text={s} dead={}", .{ result.text, result.composing });
|
// var state: State = .{};
|
||||||
}
|
// {
|
||||||
|
// const result = try keymap.translate(&buf, &state, 0x27, .{});
|
||||||
// Then type "a" which should combine with the dead key to make á
|
// std.log.warn("map: text={s} dead={}", .{ result.text, result.composing });
|
||||||
{
|
// }
|
||||||
const result = try keymap.translate(&buf, &state, 0x00, .{});
|
//
|
||||||
std.log.warn("map: text={s} dead={}", .{ result.text, result.composing });
|
// // Then type "a" which should combine with the dead key to make á
|
||||||
}
|
// {
|
||||||
|
// const result = try keymap.translate(&buf, &state, 0x00, .{});
|
||||||
// Shift+1 = ! on US
|
// std.log.warn("map: text={s} dead={}", .{ result.text, result.composing });
|
||||||
{
|
// }
|
||||||
const result = try keymap.translate(&buf, &state, 0x12, .{ .shift = true });
|
//
|
||||||
std.log.warn("map: text={s} dead={}", .{ result.text, result.composing });
|
// // Shift+1 = ! on US
|
||||||
}
|
// {
|
||||||
|
// const result = try keymap.translate(&buf, &state, 0x12, .{ .shift = true });
|
||||||
|
// std.log.warn("map: text={s} dead={}", .{ result.text, result.composing });
|
||||||
|
// }
|
||||||
}
|
}
|
Reference in New Issue
Block a user