mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-20 14:25:19 +00:00
apprt/embedded: do not depend on macOS APIs on non-macOS
This commit is contained in:
38
src/input/KeymapNoop.zig
Normal file
38
src/input/KeymapNoop.zig
Normal file
@@ -0,0 +1,38 @@
|
||||
//! A noop implementation of the keymap interface so that the embedded
|
||||
//! library can compile on non-macOS platforms.
|
||||
const KeymapNoop = @This();
|
||||
|
||||
const Mods = @import("key.zig").Mods;
|
||||
|
||||
pub const State = struct {};
|
||||
pub const Translation = struct {
|
||||
text: []const u8,
|
||||
composing: bool,
|
||||
};
|
||||
|
||||
pub fn init() !KeymapNoop {
|
||||
return .{};
|
||||
}
|
||||
|
||||
pub fn deinit(self: *const KeymapNoop) void {
|
||||
_ = self;
|
||||
}
|
||||
|
||||
pub fn reload(self: *KeymapNoop) !void {
|
||||
_ = self;
|
||||
}
|
||||
|
||||
pub fn translate(
|
||||
self: *const KeymapNoop,
|
||||
out: []u8,
|
||||
state: *State,
|
||||
code: u16,
|
||||
mods: Mods,
|
||||
) !Translation {
|
||||
_ = self;
|
||||
_ = out;
|
||||
_ = state;
|
||||
_ = code;
|
||||
_ = mods;
|
||||
return .{ .text = "", .composing = false };
|
||||
}
|
||||
Reference in New Issue
Block a user