Liresol / anki-custom-shortcuts

Custom Keyboard Shortcuts for Anki 2.1
MIT License
60 stars 14 forks source link

Startup failed on 23.12.1 qt6 #220

Open ajf12321 opened 8 months ago

ajf12321 commented 8 months ago

Anki 23.12.1 (1a1d4d54) (ao) Python 3.9.15 Qt 6.6.1 PyQt 6.6.1 Platform: Windows-10-10.0.22635

When loading Customize Keyboard Shortcuts: Traceback (most recent call last): File "aqt.addons", line 245, in loadAddons File "C:\Users\X\AppData\Roaming\Anki2\addons21\24411424__init__.py", line 1, in from . import custom_shortcuts File "C:\Users\X\AppData\Roaming\Anki2\addons21\24411424\custom_shortcuts.py", line 54, in Qt_functions = {"Qt.Key_Enter": Qt.Key_Enter, AttributeError: type object 'Qt' has no attribute 'Key_Enter'

ayushchand commented 8 months ago

Hello, the code in the dev branch works for me, There is issue with the new Anki versioning and QT6 Key bindings. Not sure why it is not in the official release. https://github.com/Liresol/anki-custom-shortcuts/tree/dev/custom_shortcuts

Liresol commented 8 months ago

Hello, The code from the dev branch is in the most recent release of this addon. I know that for some reason the version detection system doesn't inform you that a newer version is available, so a reinstall might fix the issue (if you do this remember to backup your shortcuts first since I think those get reset on reinstall).

Andrew15-5 commented 7 months ago

Indeed. I copied the meta.json, then reinstalled the addon. Then I replaced the config file and for some reason the new one had "branch_index": 2 instead of "branch_index": 1. But it works either way.

jujemido commented 6 months ago
  1. Make a backup of your shortcuts, delete the version and install it again. Close Anki
  2. Go here https://github.com/Liresol/anki-custom-shortcuts/tree/dev/custom_shortcuts, download "custom_shortcuts.py" and "cs_functions.py".
  3. Go to the Addon Folder (I'm using mac, so It should be something like "/Users/yourusername/Library/Application Support/Anki2/addons21/24411424"
  4. Replace these two files
  5. Open Anki