Making bracket keys move cursor around
Former-commit-id: 1809d22b10c4f391ce01736f1886942a55d9f0d0
This commit is contained in:
parent
bff7b14bc3
commit
d2431f2cef
@ -139,7 +139,6 @@ class MainWindowReader(QtGui.QMainWindow, gen.reader_ui.Ui_MainWindowReader):
|
||||
index = event.key() - ord('0') - 1
|
||||
if index < 0:
|
||||
index = 9
|
||||
|
||||
if event.modifiers() & QtCore.Qt.ShiftModifier:
|
||||
if event.modifiers() & QtCore.Qt.ControlModifier:
|
||||
self.executeKanjiCommand('addKanji', index)
|
||||
@ -148,6 +147,12 @@ class MainWindowReader(QtGui.QMainWindow, gen.reader_ui.Ui_MainWindowReader):
|
||||
self.executeVocabCommand('addVocabExp', index)
|
||||
if event.modifiers() & QtCore.Qt.AltModifier:
|
||||
self.executeVocabCommand('addVocabReading', index)
|
||||
elif event.key() == ord('[') and self.state.scanPosition > 0:
|
||||
self.state.scanPosition -= 1
|
||||
self.updateSampleFromPosition()
|
||||
elif event.key() == ord(']') and self.state.scanPosition < len(self.textContent.toPlainText()) - 1:
|
||||
self.state.scanPosition += 1
|
||||
self.updateSampleFromPosition()
|
||||
|
||||
|
||||
def dragEnterEvent(self, event):
|
||||
|
Loading…
Reference in New Issue
Block a user