macOS: build

This commit is contained in:
Mitchell Hashimoto
2025-05-08 10:58:41 -07:00
parent 24d433333b
commit b991d36343
5 changed files with 379 additions and 476 deletions

View File

@@ -19,7 +19,7 @@ pub const entries: []const Entry = entries: {
for (raw_entries, 0..) |raw, i| {
@setEvalBranchQuota(10000);
result[i] = .{
.key = code_to_key.get(raw[5]) orelse .invalid,
.key = code_to_key.get(raw[5]) orelse .unidentified,
.usb = raw[0],
.code = raw[5],
.native = raw[native_idx],
@@ -45,42 +45,42 @@ pub const Entry = struct {
const code_to_key = code_to_key: {
@setEvalBranchQuota(5000);
break :code_to_key std.StaticStringMap(Key).initComptime(.{
.{ "KeyA", .a },
.{ "KeyB", .b },
.{ "KeyC", .c },
.{ "KeyD", .d },
.{ "KeyE", .e },
.{ "KeyF", .f },
.{ "KeyG", .g },
.{ "KeyH", .h },
.{ "KeyI", .i },
.{ "KeyJ", .j },
.{ "KeyK", .k },
.{ "KeyL", .l },
.{ "KeyM", .m },
.{ "KeyN", .n },
.{ "KeyO", .o },
.{ "KeyP", .p },
.{ "KeyQ", .q },
.{ "KeyR", .r },
.{ "KeyS", .s },
.{ "KeyT", .t },
.{ "KeyU", .u },
.{ "KeyV", .v },
.{ "KeyW", .w },
.{ "KeyX", .x },
.{ "KeyY", .y },
.{ "KeyZ", .z },
.{ "Digit1", .one },
.{ "Digit2", .two },
.{ "Digit3", .three },
.{ "Digit4", .four },
.{ "Digit5", .five },
.{ "Digit6", .six },
.{ "Digit7", .seven },
.{ "Digit8", .eight },
.{ "Digit9", .nine },
.{ "Digit0", .zero },
.{ "KeyA", .key_a },
.{ "KeyB", .key_b },
.{ "KeyC", .key_c },
.{ "KeyD", .key_d },
.{ "KeyE", .key_e },
.{ "KeyF", .key_f },
.{ "KeyG", .key_g },
.{ "KeyH", .key_h },
.{ "KeyI", .key_i },
.{ "KeyJ", .key_j },
.{ "KeyK", .key_k },
.{ "KeyL", .key_l },
.{ "KeyM", .key_m },
.{ "KeyN", .key_n },
.{ "KeyO", .key_o },
.{ "KeyP", .key_p },
.{ "KeyQ", .key_q },
.{ "KeyR", .key_r },
.{ "KeyS", .key_s },
.{ "KeyT", .key_t },
.{ "KeyU", .key_u },
.{ "KeyV", .key_v },
.{ "KeyW", .key_w },
.{ "KeyX", .key_x },
.{ "KeyY", .key_y },
.{ "KeyZ", .key_z },
.{ "Digit1", .digit_1 },
.{ "Digit2", .digit_2 },
.{ "Digit3", .digit_3 },
.{ "Digit4", .digit_4 },
.{ "Digit5", .digit_5 },
.{ "Digit6", .digit_6 },
.{ "Digit7", .digit_7 },
.{ "Digit8", .digit_8 },
.{ "Digit9", .digit_9 },
.{ "Digit0", .digit_0 },
.{ "Enter", .enter },
.{ "Escape", .escape },
.{ "Backspace", .backspace },
@@ -88,12 +88,12 @@ const code_to_key = code_to_key: {
.{ "Space", .space },
.{ "Minus", .minus },
.{ "Equal", .equal },
.{ "BracketLeft", .left_bracket },
.{ "BracketRight", .right_bracket },
.{ "BracketLeft", .bracket_left },
.{ "BracketRight", .bracket_left },
.{ "Backslash", .backslash },
.{ "Semicolon", .semicolon },
.{ "Quote", .apostrophe },
.{ "Backquote", .grave_accent },
.{ "Quote", .quote },
.{ "Backquote", .backquote },
.{ "Comma", .comma },
.{ "Period", .period },
.{ "Slash", .slash },
@@ -131,37 +131,37 @@ const code_to_key = code_to_key: {
.{ "Delete", .delete },
.{ "End", .end },
.{ "PageDown", .page_down },
.{ "ArrowRight", .right },
.{ "ArrowLeft", .left },
.{ "ArrowDown", .down },
.{ "ArrowUp", .up },
.{ "ArrowRight", .arrow_right },
.{ "ArrowLeft", .arrow_left },
.{ "ArrowDown", .arrow_down },
.{ "ArrowUp", .arrow_up },
.{ "NumLock", .num_lock },
.{ "NumpadDivide", .kp_divide },
.{ "NumpadMultiply", .kp_multiply },
.{ "NumpadSubtract", .kp_subtract },
.{ "NumpadAdd", .kp_add },
.{ "NumpadEnter", .kp_enter },
.{ "Numpad1", .kp_1 },
.{ "Numpad2", .kp_2 },
.{ "Numpad3", .kp_3 },
.{ "Numpad4", .kp_4 },
.{ "Numpad5", .kp_5 },
.{ "Numpad6", .kp_6 },
.{ "Numpad7", .kp_7 },
.{ "Numpad8", .kp_8 },
.{ "Numpad9", .kp_9 },
.{ "Numpad0", .kp_0 },
.{ "NumpadDecimal", .kp_decimal },
.{ "NumpadEqual", .kp_equal },
.{ "NumpadDivide", .numpad_divide },
.{ "NumpadMultiply", .numpad_multiply },
.{ "NumpadSubtract", .numpad_subtract },
.{ "NumpadAdd", .numpad_add },
.{ "NumpadEnter", .numpad_enter },
.{ "Numpad1", .numpad_1 },
.{ "Numpad2", .numpad_2 },
.{ "Numpad3", .numpad_3 },
.{ "Numpad4", .numpad_4 },
.{ "Numpad5", .numpad_5 },
.{ "Numpad6", .numpad_6 },
.{ "Numpad7", .numpad_7 },
.{ "Numpad8", .numpad_8 },
.{ "Numpad9", .numpad_9 },
.{ "Numpad0", .numpad_0 },
.{ "NumpadDecimal", .numpad_decimal },
.{ "NumpadEqual", .numpad_equal },
.{ "ContextMenu", .context_menu },
.{ "ControlLeft", .left_control },
.{ "ShiftLeft", .left_shift },
.{ "AltLeft", .left_alt },
.{ "MetaLeft", .left_super },
.{ "ControlRight", .right_control },
.{ "ShiftRight", .right_shift },
.{ "AltRight", .right_alt },
.{ "MetaRight", .right_super },
.{ "ControlLeft", .control_left },
.{ "ShiftLeft", .shift_left },
.{ "AltLeft", .alt_left },
.{ "MetaLeft", .meta_left },
.{ "ControlRight", .control_right },
.{ "ShiftRight", .shift_right },
.{ "AltRight", .alt_right },
.{ "MetaRight", .meta_right },
});
};