mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macos: disable ApplePressAndHoldEnabled so that repeated key events work
This commit is contained in:
@ -11,6 +11,7 @@ struct GhosttyApp: App {
|
||||
|
||||
/// The ghostty global state. Only one per process.
|
||||
@StateObject private var ghostty = GhosttyState()
|
||||
@NSApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate;
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
@ -45,6 +46,15 @@ struct GhosttyApp: App {
|
||||
}
|
||||
}
|
||||
|
||||
class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
func applicationDidFinishLaunching(_ notification: Notification) {
|
||||
UserDefaults.standard.register(defaults: [
|
||||
// Disable this so that repeated key events make it through to our terminal views.
|
||||
"ApplePressAndHoldEnabled": false,
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
class GhosttyState: ObservableObject {
|
||||
enum Readiness {
|
||||
case loading, error, ready
|
||||
|
Reference in New Issue
Block a user