RussianCtrlZFix forwards undo and redo keyboard shortcuts with a Latin z or Z, so a Russian keyboard layout can use the usual physical Z key.

Download RussianCtrlZFix.plugin.js · Source on GitHub

Behavior

The plugin listens for keydown events with Ctrl or Meta held down. Existing Latin z / Z shortcuts pass through unchanged. For other characters, it handles an event when its physical key code is KeyZ or its character is я (case-insensitive).

  • Ctrl+Я is forwarded as Ctrl+Z for undo.
  • Adding Shift forwards Ctrl+Shift+Z for redo.
  • Meta shortcuts are forwarded in the same way.

The original event is stopped and replaced with a keyboard event on the same target. The replacement retains the modifier keys, including Alt, and the repeat state. Events already prevented by another handler are left alone. The plugin forwards shortcuts; Discord’s active editor determines whether an undo or redo operation is available.

There are no plugin settings. Disabling the plugin removes its keyboard listener.

Russian layouts are supported through the я character. Other layouts are handled when the browser reports the physical key as KeyZ.

Why

Заебало, блять, в рандомный момент не иметь возможности нажать Ctrl Z потому что долбобы из дискорда, как, в прочем, абсолютно все индусы в гигакорпорациях, не имеют никакой другой раскладки кроме английской и им глубого поебать на проблемы тех бедолаг, которым по долгу службы/рождения/ещё какой-то хуйни требуется переключать язык.