Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Corner/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
}
AppAccess.shared = self

installEditMenu()
menuBar.install()
hotCorner.start()

Expand All @@ -141,6 +142,33 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
}
}

/// Standard editing shortcuts (⌘C/⌘V/⌘X/⌘A/⌘Z) are dispatched by AppKit
/// through the main menu's Edit items. An accessory app (LSUIElement) has
/// no main menu, so without this they never reach the panel's text fields.
/// The menu is never displayed — it exists only to route key equivalents.
private func installEditMenu() {
let edit = NSMenu(title: "Edit")
edit.addItem(withTitle: String(localized: "Deshacer"),
action: Selector(("undo:")), keyEquivalent: "z")
edit.addItem(withTitle: String(localized: "Rehacer"),
action: Selector(("redo:")), keyEquivalent: "Z")
edit.addItem(.separator())
edit.addItem(withTitle: String(localized: "Cortar"),
action: #selector(NSText.cut(_:)), keyEquivalent: "x")
edit.addItem(withTitle: String(localized: "Copiar"),
action: #selector(NSText.copy(_:)), keyEquivalent: "c")
edit.addItem(withTitle: String(localized: "Pegar"),
action: #selector(NSText.paste(_:)), keyEquivalent: "v")
edit.addItem(withTitle: String(localized: "Seleccionar todo"),
action: #selector(NSText.selectAll(_:)), keyEquivalent: "a")

let editItem = NSMenuItem()
editItem.submenu = edit
let mainMenu = NSMenu()
mainMenu.addItem(editItem)
NSApp.mainMenu = mainMenu
}

private var cursorScreen: NSScreen? {
NSScreen.screens.first(where: {
NSMouseInRect(NSEvent.mouseLocation, $0.frame, false)
Expand Down
60 changes: 60 additions & 0 deletions Corner/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,16 @@
}
}
},
"Copiar": {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Copy"
}
}
}
},
"Corner no pudo guardar en disco": {
"extractionState": "manual",
"localizations": {
Expand Down Expand Up @@ -273,6 +283,16 @@
}
}
},
"Cortar": {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Cut"
}
}
}
},
"Crear": {
"extractionState": "manual",
"localizations": {
Expand Down Expand Up @@ -306,6 +326,16 @@
}
}
},
"Deshacer": {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Undo"
}
}
}
},
"Editar…": {
"extractionState": "manual",
"localizations": {
Expand Down Expand Up @@ -534,6 +564,16 @@
}
}
},
"Pegar": {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Paste"
}
}
}
},
"Permiso de Recordatorios denegado": {
"localizations": {
"en": {
Expand Down Expand Up @@ -584,6 +624,16 @@
}
}
},
"Rehacer": {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Redo"
}
}
}
},
"Revisa tu conexión a internet e intenta de nuevo.": {
"extractionState": "manual",
"localizations": {
Expand All @@ -606,6 +656,16 @@
}
}
},
"Seleccionar todo": {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Select All"
}
}
}
},
"Semana": {
"extractionState": "manual",
"localizations": {
Expand Down
8 changes: 8 additions & 0 deletions docs/SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ Tener las tareas del día y de la semana a un gesto de distancia — mover el mo
inferior izquierda · ⌥Espacio", con botón ✕. Persiste entre aperturas hasta
que se descarta; descartada, no vuelve jamás (UserDefaults).

### Atajos de edición estándar (v2.2.1, 2026-07-25)

- En los campos del panel y de la captura rápida funcionan **⌘C, ⌘V, ⌘X, ⌘A y
⌘Z**. AppKit reparte esos atajos por los ítems del menú Editar de la app, y
Corner —al ser accesoria (`LSUIElement`)— no tenía menú principal: por eso
las teclas no llegaban a los campos. Se instala un menú Editar que **nunca se
muestra**; existe solo para enrutar las teclas.

### Cierre
El panel se cierra cuando ocurre cualquiera de:
- Clic fuera del panel (en otra app o el escritorio). Interactuar con UI colgada del panel — popovers del editor de categorías, menús contextuales — cuenta como "dentro" y nunca lo cierra.
Expand Down
Loading