summaryrefslogtreecommitdiff
path: root/src/input/KeymapNoop.zig
blob: b6a9d57b967466106059e4614420229557bda9e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! 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 = false,
    mods: Mods = .{},
};

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 };
}