clean up bindings so that they match macOS menus

This commit is contained in:
Mitchell Hashimoto
2025-05-08 21:08:00 -07:00
parent 5962696c3b
commit d015efc87d
3 changed files with 16 additions and 10 deletions

View File

@@ -1043,12 +1043,16 @@ extension Ghostty {
}
// If this event as-is would result in a key binding then we send it.
if let surface,
ghostty_surface_key_is_binding(
surface,
event.ghosttyKeyEvent(GHOSTTY_ACTION_PRESS)) {
self.keyDown(with: event)
return true
if let surface {
var ghosttyEvent = event.ghosttyKeyEvent(GHOSTTY_ACTION_PRESS)
let match = (event.characters ?? "").withCString { ptr in
ghosttyEvent.text = ptr
return ghostty_surface_key_is_binding(surface, ghosttyEvent)
}
if match {
self.keyDown(with: event)
return true
}
}
let equivalent: String