8 QKeySequence standard keys. |
8 QKeySequence standard keys. |
9 """ |
9 """ |
10 |
10 |
11 from __future__ import unicode_literals |
11 from __future__ import unicode_literals |
12 |
12 |
13 from PyQt5.QtCore import qVersion |
|
14 from PyQt5.QtGui import QKeySequence |
13 from PyQt5.QtGui import QKeySequence |
15 from PyQt5.Qsci import QsciScintilla |
14 from PyQt5.Qsci import QsciScintilla |
|
15 |
|
16 from Globals import qVersionTuple |
16 |
17 |
17 __all__ = ["s2qTranslate"] |
18 __all__ = ["s2qTranslate"] |
18 |
19 |
19 Scintilla2QKeySequence = { |
20 Scintilla2QKeySequence = { |
20 QsciScintilla.SCI_CHARLEFT: QKeySequence.MoveToPreviousChar, |
21 QsciScintilla.SCI_CHARLEFT: QKeySequence.MoveToPreviousChar, |
106 QsciScintilla.SCI_MOVESELECTEDLINESUP: QKeySequence.UnknownKey, |
107 QsciScintilla.SCI_MOVESELECTEDLINESUP: QKeySequence.UnknownKey, |
107 QsciScintilla.SCI_MOVESELECTEDLINESDOWN: QKeySequence.UnknownKey, |
108 QsciScintilla.SCI_MOVESELECTEDLINESDOWN: QKeySequence.UnknownKey, |
108 QsciScintilla.SCI_LOWERCASE: QKeySequence.UnknownKey, |
109 QsciScintilla.SCI_LOWERCASE: QKeySequence.UnknownKey, |
109 QsciScintilla.SCI_UPPERCASE: QKeySequence.UnknownKey, |
110 QsciScintilla.SCI_UPPERCASE: QKeySequence.UnknownKey, |
110 } |
111 } |
111 if qVersion() >= "5.2.0": |
112 if qVersionTuple() >= (5, 2, 0): |
112 Scintilla2QKeySequence[QsciScintilla.SCI_LINEDELETE] = \ |
113 Scintilla2QKeySequence[QsciScintilla.SCI_LINEDELETE] = \ |
113 QKeySequence.DeleteCompleteLine, |
114 QKeySequence.DeleteCompleteLine, |
114 if qVersion() >= "5.5.0": |
115 if qVersionTuple() >= (5, 5, 0): |
115 Scintilla2QKeySequence[QsciScintilla.SCI_DELETEBACK] = \ |
116 Scintilla2QKeySequence[QsciScintilla.SCI_DELETEBACK] = \ |
116 QKeySequence.Backspace |
117 QKeySequence.Backspace |
117 |
118 |
118 |
119 |
119 def s2qTranslate(scintillaCommand): |
120 def s2qTranslate(scintillaCommand): |