apprt/embedded: handle repeat events

This commit is contained in:
Mitchell Hashimoto
2023-08-10 15:13:01 -07:00
parent d02bf322f8
commit d5df8aea9a
2 changed files with 3 additions and 2 deletions

View File

@ -367,7 +367,7 @@ extension Ghostty {
private func keyAction(_ action: ghostty_input_action_e, event: NSEvent) {
guard let surface = self.surface else { return }
let mods = Self.translateFlags(event.modifierFlags)
ghostty_surface_key2(surface, action, UInt32(event.keyCode), mods)
ghostty_surface_key(surface, action, UInt32(event.keyCode), mods)
}
// MARK: Menu Handlers

View File

@ -387,7 +387,8 @@ pub const Surface = struct {
keycode: u32,
mods: input.Mods,
) !void {
if (action != .press) return;
// We don't handle release events because we don't use them yet.
if (action != .press and action != .repeat) return;
// Translate our key using the keymap for our localized keyboard layout.
var buf: [128]u8 = undefined;