aboutsummaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAdrien Tétar2015-10-20 09:43:32 +0200
committerAdrien Tétar2015-10-20 09:47:34 +0200
commit8d2f535a8b355c41abed30d62a2647ae0de2df8a (patch)
tree686684b9342359873f94b231cb773715c6a5c15e /Lib
parent21e5454735e6bb975d44747114e851d015682588 (diff)
downloadtrufont-8d2f535a8b355c41abed30d62a2647ae0de2df8a.tar.bz2
glyphCollectionView: fix unicodedata check
Diffstat (limited to 'Lib')
-rw-r--r--Lib/defconQt/glyphCollectionView.py7
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()