Skip to content

Commit

Permalink
Add 'Delete' hotkey (Alt+Del)
Browse files Browse the repository at this point in the history
  • Loading branch information
glutanimate committed Aug 5, 2017
1 parent 7b401e4 commit 6119bae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion advanced_previewer/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .forms import settings

# dsp: show both sides by default
# ftr: enable card reviewing
# rev: card review settings
default_prefs = {
"dsp": [False],
"rev": [False, False, False, False],
Expand Down
5 changes: 3 additions & 2 deletions advanced_previewer/previewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from aqt.utils import (getBase, mungeQA, openLink,
saveGeom, restoreGeom, tooltip, askUser)


from anki.lang import _
from anki.consts import *

Expand All @@ -36,6 +35,7 @@
PRIMARY_KEYS = (Qt.Key_1, Qt.Key_2, Qt.Key_3, Qt.Key_4) # 1,2,3,4
SECONDARY_KEYS = (Qt.Key_J, Qt.Key_K, Qt.Key_L, Qt.Key_Odiaeresis) # J,K,L,Ö


# support for JS Booster add-on
try:
from jsbooster.location_hack import getBaseUrlText, stdHtmlWithBaseUrl
Expand Down Expand Up @@ -154,6 +154,8 @@ def setupHotkeys(self):
self, activated=self.b.onSuspend)
susCut = QShortcut(QKeySequence(_("Ctrl+K")),
self, activated=self.b.onMark)
delCut = QShortcut(QKeySequence(_("Alt+Delete")),
self, activated=self.b.deleteNotes)
startCut = QShortcut(QKeySequence(_("Alt+Home")),
self, activated=lambda: self.onMove("s"))
endCut = QShortcut(QKeySequence(_("Alt+End")),
Expand Down Expand Up @@ -624,7 +626,6 @@ def _refreshCurrentCard(self, note):
self._previewWindow.renderPreview(False)



Browser.onTogglePreview = wrap(Browser.onTogglePreview, onTogglePreview)
Browser._openPreview = _openPreview
Browser._onClosePreview = _onClosePreview
Expand Down

0 comments on commit 6119bae

Please sign in to comment.