ijgnd / anki21__editor_add_hyperlink

5 stars 7 forks source link

Config file fails to modify key shortcuts #1

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hi, currently using Anki 2.1.11 (3cf770c7) on Mac OSX 10.14.1.

I tried modifying the key shortcut "shortcut_insert_link": "Ctrl+Shift+H" from "Ctrl+Shift+H" to "Ctrl+R" in Add-ons > Config but the new key shortcut fails to work. I also tried editing meta.json in the Add-on folder but that doesn't fix anything. Anyone have any suggestions?

ijgnd commented 5 years ago
ghost commented 5 years ago

Just to be sure: "Ctrl+Shift+H" works for you and the only problem is that "Ctrl+R" is not working?

Correct.

"Ctrl+R" (on windows/linux) is a built-in short cut to remove formatting: you can see this if you hover with your mouse over the button Fx (if B (bold) is the first button this "remove formatting" button is the sixth button from the left). The add-on can't overwrite such built-in commands

Since I've read your comment, I changed the key strokes in the config file to "Ctrl+X" and "Ctrl+Shift+X" but both fail to do anything (after restarting Anki etc).

I don't have a Mac. But as far as I know where on Linux/Windows you would use "Ctrl" on Mac you use "Cmd". If you set "Ctrl" in the deck settings Anki seems to automatically translate this to "Cmd" so that you might have to press "Cmd+R" or "Cmd+Shift+H", see https://anki.tenderapp.com/discussions/ankidesktop/30282-is-there-a-shortcut-for-mac-for-colors#comment_46398286

I'm using the Cmd key.

ijgnd commented 5 years ago
ghost commented 5 years ago

Yeah, that was a dumb mistake. I used a key combination that was random (Ctrl+G) and the config file was successful. Thanks for all of your help!