mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
shortcut()
This commit is contained in:
parent
6f0168aec1
commit
1cdc92d7f5
1 changed files with 9 additions and 12 deletions
|
@ -155,16 +155,6 @@ $(function () {
|
|||
</body></html>
|
||||
"""
|
||||
|
||||
# fixme: use shortcut() for mac shortcuts
|
||||
|
||||
if sys.platform.startswith("win32"):
|
||||
ActivateKeyboardLayout = ctypes.windll.user32.ActivateKeyboardLayout
|
||||
ActivateKeyboardLayout.restype = ctypes.c_void_p
|
||||
ActivateKeyboardLayout.argtypes = [ctypes.c_void_p, ctypes.c_uint]
|
||||
GetKeyboardLayout = ctypes.windll.user32.GetKeyboardLayout
|
||||
GetKeyboardLayout.restype = ctypes.c_void_p
|
||||
GetKeyboardLayout.argtypes = [ctypes.c_uint]
|
||||
|
||||
class Editor(object):
|
||||
def __init__(self, mw, widget):
|
||||
self.widget = widget
|
||||
|
@ -228,7 +218,7 @@ class Editor(object):
|
|||
if key:
|
||||
b.setShortcut(QKeySequence(key))
|
||||
if tip:
|
||||
b.setToolTip(tip)
|
||||
b.setToolTip(shortcut(tip))
|
||||
if check:
|
||||
b.setCheckable(True)
|
||||
self.iconsBox.addWidget(b)
|
||||
|
@ -838,12 +828,19 @@ class EditorWebView(AnkiWebView):
|
|||
file.close()
|
||||
return self.editor._addMedia(path)
|
||||
|
||||
|
||||
def _tmpDir(self):
|
||||
if not self.__tmpDir:
|
||||
self.__tmpDir = tempfile.mkdtemp(prefix="anki")
|
||||
return self.__tmpDir
|
||||
|
||||
# if sys.platform.startswith("win32"):
|
||||
# ActivateKeyboardLayout = ctypes.windll.user32.ActivateKeyboardLayout
|
||||
# ActivateKeyboardLayout.restype = ctypes.c_void_p
|
||||
# ActivateKeyboardLayout.argtypes = [ctypes.c_void_p, ctypes.c_uint]
|
||||
# GetKeyboardLayout = ctypes.windll.user32.GetKeyboardLayout
|
||||
# GetKeyboardLayout.restype = ctypes.c_void_p
|
||||
# GetKeyboardLayout.argtypes = [ctypes.c_uint]
|
||||
|
||||
# def focusOutEvent(self, evt):
|
||||
# if self.mw.config['preserveKeyboard'] and sys.platform.startswith("win32"):
|
||||
# self._ownLayout = GetKeyboardLayout(0)
|
||||
|
|
Loading…
Reference in a new issue