diff options
| author | Adrien Tétar | 2015-10-20 09:43:32 +0200 |
|---|---|---|
| committer | Adrien Tétar | 2015-10-20 09:47:34 +0200 |
| commit | 8d2f535a8b355c41abed30d62a2647ae0de2df8a (patch) | |
| tree | 686684b9342359873f94b231cb773715c6a5c15e | |
| parent | 21e5454735e6bb975d44747114e851d015682588 (diff) | |
| download | trufont-8d2f535a8b355c41abed30d62a2647ae0de2df8a.tar.bz2 | |
glyphCollectionView: fix unicodedata check
| -rw-r--r-- | Lib/defconQt/glyphCollectionView.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/defconQt/glyphCollectionView.py b/Lib/defconQt/glyphCollectionView.py index 951b3c4..d7c3188 100644 --- a/Lib/defconQt/glyphCollectionView.py +++ b/Lib/defconQt/glyphCollectionView.py @@ -248,6 +248,9 @@ class GlyphCollectionWidget(QWidget): self.lastSelectedCell = newSel def keyPressEvent(self, event): + def isUnicodeChar(char): + return len(char) and unicodedata.category(char) != "Cc" + key = event.key() modifiers = event.modifiers() if key in arrowKeys: @@ -279,8 +282,8 @@ class GlyphCollectionWidget(QWidget): # XXX: have template setter clear glyph content glyph.template = True self.selection = set() - elif (modifiers in (Qt.NoModifier, Qt.ShiftModifier) and - unicodedata.category(event.text()) != "Cc"): + elif modifiers in (Qt.NoModifier, Qt.ShiftModifier) and \ + isUnicodeChar(event.text()): # adapted from defconAppkit # get the current time rightNow = time.time() |
