mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-28 10:01:38 +00:00
macos: remove the ability to bind fn/globe
This was recently introduced a few days ago. Unfortunately, this doesn't work as expected. The "function" modifier is not actually the fn key but used by macOS to represent a variety of "functional" key presses. This breaks other bindings such as #2411. I can't find a source on the internet that reliably tells me how we can detect fn key presses, but I do find a number of sources that tell us we can't.
This commit is contained in:
@@ -354,11 +354,6 @@ class AppDelegate: NSObject,
|
||||
return
|
||||
}
|
||||
|
||||
if (equiv.modifiers.contains(.function)) {
|
||||
// NSMenuItem key equivalent cannot contain function modifiers.
|
||||
return
|
||||
}
|
||||
|
||||
menu.keyEquivalent = equiv.key
|
||||
menu.keyEquivalentModifierMask = equiv.modifiers
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ extension Ghostty {
|
||||
if (mods.rawValue & GHOSTTY_MODS_CTRL.rawValue != 0) { flags.insert(.control) }
|
||||
if (mods.rawValue & GHOSTTY_MODS_ALT.rawValue != 0) { flags.insert(.option) }
|
||||
if (mods.rawValue & GHOSTTY_MODS_SUPER.rawValue != 0) { flags.insert(.command) }
|
||||
if (mods.rawValue & GHOSTTY_MODS_FN.rawValue != 0) { flags.insert(.function) }
|
||||
return flags
|
||||
}
|
||||
|
||||
@@ -26,7 +25,6 @@ extension Ghostty {
|
||||
if (flags.contains(.control)) { mods |= GHOSTTY_MODS_CTRL.rawValue }
|
||||
if (flags.contains(.option)) { mods |= GHOSTTY_MODS_ALT.rawValue }
|
||||
if (flags.contains(.command)) { mods |= GHOSTTY_MODS_SUPER.rawValue }
|
||||
if (flags.contains(.function)) { mods |= GHOSTTY_MODS_FN.rawValue }
|
||||
if (flags.contains(.capsLock)) { mods |= GHOSTTY_MODS_CAPS.rawValue }
|
||||
|
||||
// Handle sided input. We can't tell that both are pressed in the
|
||||
|
||||
@@ -743,7 +743,6 @@ extension Ghostty {
|
||||
case 0x3B, 0x3E: mod = GHOSTTY_MODS_CTRL.rawValue
|
||||
case 0x3A, 0x3D: mod = GHOSTTY_MODS_ALT.rawValue
|
||||
case 0x37, 0x36: mod = GHOSTTY_MODS_SUPER.rawValue
|
||||
case 0x3F: mod = GHOSTTY_MODS_FN.rawValue
|
||||
default: return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user