Obsidian triggers not listed shortcuts instead of typing third-level characters

In some cases when I try to enter certain Cyrillic letters defined in the third level of one of my keyboard layouts (one of default macOS layouts) Obsidian instead triggers shortcuts that are not listed in “Settings > Hotkeys”. This makes makes writing in Obsidian impossible because I just can’t type certain letters.

Please read the Additional information section because I found the root cause of this issue.

Steps to reproduce

  1. Get a device with macOS (this issue almost certainly happens only on macOS).
  2. Open “System Preferences > Keyboard > Input Sources”
    1. Click “+” to add keyboard layout.
    2. Choose “Russian” language
    3. Choose “Russian - PC” keyboard layout.
    4. Click “Add”.
  3. Open Obsidian editor and create an empty note.
  4. Type “Hello world”.
  5. Select “Russian - PC” layout.
  6. Press ⌥B (Option-B).
  7. Press ⇧⌥B (Shift-Option-B).

Expected result

At Step 6 I expected to type letter “і” (Cyrillic small dotted i).
At Step 7 I expected to type letter “І” (Cyrillic capital dotted i).
So the final text should look like “Hello worldіІ”.
Additionally I expect to see all Obsidian shortcuts in “Settings > Hotkeys”.

This is the way every other macOS editor behaves so you can reproduce same steps in VSCode, TextEdit etc. and make sure they type those letters instead of triggering shortcuts.
You can also see those characters if you open Keyboard Viewer from Input menu in the macOS menu bar.

Actual result

At Step 6 no characters are typed and Obisidan moves cursor to the beginning of the word “world”.
At Step 7 no characters are typed and Obisidan moves cursor to the beginning of the word “Hello” and selects "Hello ".

So apparently Obsidian treats ⌥B (Option-B) as shorcut to move cursor to the previous word; and ⇧⌥B (Shift-Option-B) as shortcut to select previous word. However these shortcuts are not displayed in “Settings > Hotkeys” and therefore cannot be modified or unbound.

Environment

  • Operating system: macOS Catalina 10.15.7
  • Obsidian version: 0.9.17

Additional information

Obsidian uses CodeMirror as an editor. CodeMirror defines shortcuts in CodeMirror.keyMap object. I’m on macOS and the default keymap for macOS is CodeMirror.keyMap.macDefault.

However this keymap additionally specifies other keymaps as fallthrough: CodeMirror.keyMap.macDefault.fallthrough=["basic", "emacsy"] and “emacsy” one unsurprisingly defines some emacs-like keybindings. ⌥B (Option-B) happens to be one of those “emacsy” shortcuts that prevent me from typing some letters.

What is surprising though is that those emacs-like keybindings are default for every macOS user; CodeMirror.keyMap.pcDefault only specifies “basic” keymap as fallthrough so you might not be able to reproduce this issue on other OS.

Using devtools I manually removed “emacsy” from the list of fallthrough keymaps by assigning CodeMirror.keyMap.macDefault.fallthrough=["basic"]. After I’ve done that I was able to type those Cyrillic dotted i’s using [⇧]⌥B ([Shift]-Option-B) immideatly without reloading Obsidian.

Can you please either remove “emacsy” from the list of CodeMirror’s fallthrough keymaps for the default macOS keymaps and/or allow to remap all Obsidian shortcuts in “Settings > Hotkeys”?

2 Likes

Thanks for the detailed report. We’ll look into it.

Steps to reproduce

Hold “alt + D”

Expected result

The retroflex lower-case letter d (i.e., “ḍ”) as per my keyboard layout

Actual result

The command deletes any subsequent text (without “ḍ” appearing)

Environment

  • Operating system: Mac OS Catalina
  • Obsidian version: v0.10.13

Additional information

  • The alt+D command gives me “ḍ” in the search box but not in text edit
  • The command alt+shift+D correctly gives me the upper-case retroflex D (“Ḍ”)
  • All the other diacritics I use with the alt key still work fine
  • The command works correctly in other text editors, such as TextEdit, BBEdit.
  • The EasyUnicode developer’s web page is defunct. But the download can be found here under “Download EasyUnicode.”
  • Full disclosure: I posted this issue here to Help first mistakenly noting that it was the cmd+D command that was causing issues.

people suggested to remap the keyboard shortcut alt-d to something else in obsidian settings, did you do it?

When I thought I was dealing with a cmd-d issue, I deleted that keyboard shortcut (for delete paragraph). But since the issue is actually with the alt-d command, it didn’t resolve anything. Is there an alt-D a keyboard shortcut? I didn’t find one in the hotkeys list in settings.

do you have this problem here:

https://codemirror.net/

I think you do. I think you have this problem

Thank you @WhiteNoise for this. The issue does sound similar. But I’m not computer-literate enough to understand the instructions for how to fix it. Would you mind either 1. explaining in layperson’s terms how to execute this or 2. suggesting a resource where I could learn the necessary skills to do this on my own? (Apologies in advance if this request is beyond the scope of the list)

Oh, another piece to this: I tried creating another keyboard shortcut for “ḍ” in Mac preferences–one that didn’t use the alt key. The shortcut worked in other text editors but not in Obsidian.

The instruction are rather tecnical. It’s due to a default settings used by codemirror (our editor). Not much you can do about it. I am not sure if/when we will address this.

I don’t think fake os level shortcuts work in obsidian.

You are also using a non standard keyboard layout. Can you use a standard keyboard layout that does not rely on alt keys?

we’ll look into this, I understand we should should address this.

1 Like

I just went through all of the standard Mac keyboard layouts that support the romanized scripts that I work with. Unfortunately, they all rely on the alt key. Thanks for looking into solutions!

will be fixed in 0.11.10 with an option in the editor settings to disable emacsy shortcuts

1 Like

Hooray! It looks like this issue has been resolved. I can now type “ḍ” with abandon :smiley: Thanks to the Obsidian team for being so on top of things.