The ctrl fast path unconditionally returned after calling ghostty_surface_key, even when it returned false (e.g. ignore keybindings), preventing IMEs from receiving Ctrl-modified key events. Now falls through to interpretKeyEvents when the key is not handled. Also adds keyboard layout change detection around interpretKeyEvents (matching Ghostty upstream) so that IME-triggered layout switches cause an early return instead of sending the key to Ghostty. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
14 lines
463 B
Swift
14 lines
463 B
Swift
import Carbon
|
|
|
|
class KeyboardLayout {
|
|
/// Return a string ID of the current keyboard input source.
|
|
static var id: String? {
|
|
if let source = TISCopyCurrentKeyboardInputSource()?.takeRetainedValue(),
|
|
let sourceIdPointer = TISGetInputSourceProperty(source, kTISPropertyInputSourceID) {
|
|
let sourceId = unsafeBitCast(sourceIdPointer, to: CFString.self)
|
|
return sourceId as String
|
|
}
|
|
|
|
return nil
|
|
}
|
|
}
|