Skip to content
megabydePublic

About

Fixes English/Russian keyboard-layout mistakes as you type. An offline input method for macOS and Windows (alpha).

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Keyrill

Русская версия

Keyrill fixes English/Russian keyboard-layout mistakes as you type. It runs offline and is available as an alpha for macOS and Windows. Linux is planned.

Install on macOS · Install on Windows

Examples of ghbdtn turning into привет and руддщ turning into hello.

With automatic correction enabled, press Space after the word.

How it works

Select a Keyrill input source for English or Russian. Keyrill uses a built-in frequency model to decide whether a word belongs in the other layout and protects words in your personal dictionaries. It does not log, save or send what you type.

Keyboard shortcuts

Action macOS Windows
Convert the current word ⌃ Control+⌥ Option+K Left Ctrl+Left Alt+K
Reverse the correction immediately ⌃ Control+⌥ Option+Z Left Ctrl+Left Alt+Z
Restore the original and finish the marked word Esc Esc

The shortcuts work on the current word in supported fields. On Windows, use the physical K and Z positions in either layout.

macOS

Select Keyrill EN or Keyrill RU. The input menu shows whether correction is ready. Correction in This App changes the mode for the current application. Source switching after automatic correction can be turned off in Settings.

  • Composition (TextEdit, Safari, Firefox) edits only the marked word after checking its text, range and caret. See the composition edit contract.
  • Compatibility (terminals, editors, Microsoft Office and other unlisted applications) uses simulated Backspaces and typing. Unlisted apps default to manual correction, with automatic correction available in Settings. This mode needs Accessibility and Input Monitoring. Typing during a rewrite, focus changes, autocompletion and terminal interfaces can lose keystrokes or corrupt the word. See ADR 006.
  • Off passes keys through in excluded apps such as password managers and remote desktops.

The macOS application tiers list the built-in defaults.

Windows

Select Keyrill English or Keyrill Русский. Automatic correction starts off. To turn it on, select Enable automatic correction in admitted controls in Keyrill Settings.

Note

Windows correction was verified in the main editing field of Notepad 11.2609.11.0 x64. Fields outside the supported set pass input through. See the Windows application checks for tested versions and fields.

Install from source

macOS setup

You need Apple Silicon macOS with Command Line Tools and Rust (rustup installs the exact toolchain from rust-toolchain.toml on first use).

  1. Build, sign and copy the alpha bundle to your Input Methods folder:

    $ make install

    The bundle is signed ad hoc, which gives every build a different code requirement, so macOS may ask for the compatibility permissions again after each update. Create a self-signed code-signing certificate in Keychain Access and pass its name to keep the requirement stable: make install SIGN_IDENTITY="Keyrill Local". make bundle builds and signs target/alpha.noindex/KeyrillAlpha.app without installing it.

  2. In System Settings > Keyboard > Input Sources, add Keyrill EN and Keyrill RU and select one of them. A newly installed input method sometimes appears only after logging out and back in.

  3. Open Settings… from the Keyrill input menu and enable automatic correction.

    The default dictionary paths are ~/.vim/spell/en.utf-8.add and ~/.vim/spell/ru.utf-8.add. A missing file at a default path counts as empty. A missing file at a path you chose keeps automatic correction off, so a typo there doesn't silently drop your protected words.

    Use words added with Learn Spelling is off by default. To protect those words, click Choose… beside the checkbox, select Apple's LocalDictionary in the folder the picker opens, then click Save. macOS may grant access when the file is selected; Cancel in Settings does not revoke access already granted. Check the input menu for read failures. If access is lost after a restart or update, choose the file again. Without access, correction works without those words.

  4. For compatibility mode, grant Keyrill Alpha access under Privacy & Security > Accessibility and Input Monitoring. Keyrill checks both without prompting when a compatibility application is active, and the input menu shows what is missing. Without them, those applications get plain typing and no correction.

To update, select stock U.S. and run make install again, with the same SIGN_IDENTITY. It quits the running server before replacing the bundle, because copying over the bundle of a running server can get it killed for an invalid code signature.

The new server starts when you select a Keyrill mode again. Settings are kept.

To uninstall, remove both modes from Input Sources, quit the server, delete ~/Library/Input Methods/KeyrillAlpha.app and, if you want the settings gone too, run defaults delete org.keyrill.inputmethod.alpha. Keyrill never modifies your dictionary files.

Windows setup

Use an x64 Windows host with the build prerequisites. The package includes TSF adapters for 64-bit and 32-bit applications.

  1. Build and verify the package.
  2. Add the standard U.S. and Russian keyboard layouts, then install the package as administrator.
  3. Enable and select a Keyrill input profile in Windows.

Known limitations on macOS

Warning

Secure Input stops correction. Compatibility mode can hold sensitive typing in memory in password fields or hidden terminal prompts that leave Secure Input off.

  • Only the word being typed can be corrected: the mark in composition, the word Keyrill tracks in compatibility mode. An arbitrary committed range or a selection can't be converted.
  • In English mode, the keys that type [ ] ; ' , . and \ count as letters, because they are х, ъ, ж, э, б, ю and ё in Russian: [jhjij becomes хорошо. While the word is marked, an editor's smart quotes and automatic bracket pairing may not apply to them.
  • In raw-key terminals, the manual shortcuts can reach the terminal as well.

Documentation

The same documents, with the Rust API, are published at https://megabyde.github.io/keyrill/.

License

Keyrill's source is MIT-licensed. The language model is derived from wordfreq data under CC BY-SA 4.0, and the evaluation corpora carry their own licenses; MIT does not relicense them. See assets and model.

About

Fixes English/Russian keyboard-layout mistakes as you type. An offline input method for macOS and Windows (alpha).

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages