aboutsummaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
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()