mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
add hidden option to disable keyboard preservation
This commit is contained in:
parent
90f419b088
commit
ebebd93548
2 changed files with 3 additions and 2 deletions
|
@ -69,6 +69,7 @@ class Config(dict):
|
|||
'mediaLocation': "",
|
||||
'mainWindowState': None,
|
||||
'numBackups': 30,
|
||||
'preserveKeyboard': True,
|
||||
'preventEditUntilAnswer': False,
|
||||
'proxyHost': '',
|
||||
'proxyPass': '',
|
||||
|
|
|
@ -1111,7 +1111,7 @@ class FactEdit(QTextEdit):
|
|||
self.parent.lastFocusedEdit = self
|
||||
self.parent.resetFormatButtons()
|
||||
self.parent.disableButtons()
|
||||
if sys.platform.startswith("win32"):
|
||||
if ankiqt.mw.config['preserveKeyboard'] and sys.platform.startswith("win32"):
|
||||
self._ownLayout = GetKeyboardLayout(0)
|
||||
ActivateKeyboardLayout(self._programLayout, 0)
|
||||
self.emit(SIGNAL("lostFocus"))
|
||||
|
@ -1131,7 +1131,7 @@ class FactEdit(QTextEdit):
|
|||
QTextEdit.focusInEvent(self, evt)
|
||||
self.parent.formatChanged(None)
|
||||
self.parent.enableButtons()
|
||||
if sys.platform.startswith("win32"):
|
||||
if ankiqt.mw.config['preserveKeyboard'] and sys.platform.startswith("win32"):
|
||||
self._programLayout = GetKeyboardLayout(0)
|
||||
if self._ownLayout == None:
|
||||
self._ownLayout = self._programLayout
|
||||
|
|
Loading…
Reference in a new issue