Problem
RightLayout does not work in Electron-based apps (tested with Cursor IDE). Both auto-correction and manual hotkey correction fail silently.
Manual hotkey: selecting text and double-tapping Option clears the selection but no correction happens.
Auto-correction: typing in the wrong layout produces no correction as you type.
Native macOS apps (TextEdit, Notes) work correctly.
Environment
- macOS (Apple Silicon)
- RightLayout v1.2
- Cursor IDE (Electron/Chromium-based)
- Accessibility and Input Monitoring permissions granted
Root Cause Analysis
Reviewed the source code in EventMonitor.swift (handleHotkeyPress). The manual hotkey tries 5 strategies in order:
- Existing cycling state — N/A on first press
- Pending suggestion — N/A (no auto-correction happened)
snapshotSelectionForManualAction() — fails: Electron apps don't expose selected text properly via AXUIElement
inputSession.typedToken — empty: Electron's input handling doesn't feed the event tap the same way native apps do
- Clipboard fallback (
getSelectedTextViaClipboard) — gated: requires selectionIntentState.isActive(), which checks for an AX selection notification within 3 seconds. Electron apps don't fire these AX notifications, so the gate never opens
The clipboard fallback code (strategy 5) would work if it were allowed to run — the infrastructure is already there.
Suggested Fix
For apps where AX selection reading is unavailable (Electron, Chromium-based), bypass the selectionIntentState guard and attempt the clipboard fallback directly. For example:
// Current (too restrictive):
guard hostProfile.allowsManualSelectionClipboardFallback,
selectionIntentState.isActive(at: timeProvider.now) else { return }
// Proposed (allow fallback when AX selection failed):
guard hostProfile.allowsManualSelectionClipboardFallback else { return }
// selectionIntentState check is useful for native apps but blocks Electron apps entirely
Alternatively, maintain a list of known Electron bundle IDs (e.g. com.todesktop.*, com.electron.*, com.microsoft.VSCode) and skip the selectionIntentState gate for those.
Steps to Reproduce
- Open Cursor IDE (or VS Code)
- Type
ghbdtn (Russian word "привет" typed in English layout)
- Observe: no auto-correction happens
- Select the text, double-tap Right Option
- Observe: selection clears, text remains unchanged
Expected Behavior
- Auto-correction should convert
ghbdtn → привет as you type
- Manual hotkey should convert selected text between EN/RU/HE alternatives
Problem
RightLayout does not work in Electron-based apps (tested with Cursor IDE). Both auto-correction and manual hotkey correction fail silently.
Manual hotkey: selecting text and double-tapping Option clears the selection but no correction happens.
Auto-correction: typing in the wrong layout produces no correction as you type.
Native macOS apps (TextEdit, Notes) work correctly.
Environment
Root Cause Analysis
Reviewed the source code in
EventMonitor.swift(handleHotkeyPress). The manual hotkey tries 5 strategies in order:snapshotSelectionForManualAction()— fails: Electron apps don't expose selected text properly via AXUIElementinputSession.typedToken— empty: Electron's input handling doesn't feed the event tap the same way native apps dogetSelectedTextViaClipboard) — gated: requiresselectionIntentState.isActive(), which checks for an AX selection notification within 3 seconds. Electron apps don't fire these AX notifications, so the gate never opensThe clipboard fallback code (strategy 5) would work if it were allowed to run — the infrastructure is already there.
Suggested Fix
For apps where AX selection reading is unavailable (Electron, Chromium-based), bypass the
selectionIntentStateguard and attempt the clipboard fallback directly. For example:Alternatively, maintain a list of known Electron bundle IDs (e.g.
com.todesktop.*, com.electron.*, com.microsoft.VSCode) and skip theselectionIntentStategate for those.Steps to Reproduce
ghbdtn(Russian word "привет" typed in English layout)Expected Behavior
ghbdtn→приветas you type