From 80083054465a560825676cf1e6e944f6572c473b Mon Sep 17 00:00:00 2001 From: Adrien Tétar Date: Wed, 14 Oct 2015 14:04:15 +0200 Subject: meta: use backspace as Del key on OSX, refactor --- Lib/defconQt/groupsView.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Lib/defconQt/groupsView.py') diff --git a/Lib/defconQt/groupsView.py b/Lib/defconQt/groupsView.py index 6a15541..9772528 100644 --- a/Lib/defconQt/groupsView.py +++ b/Lib/defconQt/groupsView.py @@ -1,4 +1,5 @@ from defconQt.glyphCollectionView import GlyphCollectionWidget +from defconQt.util import platformSpecific from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * @@ -20,7 +21,7 @@ class GroupListWidget(QListWidget): def keyPressEvent(self, event): key = event.key() - if key == Qt.Key_Delete: + if key == platformSpecific.deleteKey: self.parent()._groupDelete() event.accept() elif key == Qt.Key_Left: @@ -90,7 +91,7 @@ class GroupCollectionWidget(GlyphCollectionWidget): # TODO: The standard QListWidget has scrollbar and does not need three times parent call. # Find out how to handle that properly. def keyPressEvent(self, event): - if event.key() == Qt.Key_Delete: + if event.key() == platformSpecific.deleteKey: if self.characterDeletionCallback is not None: self.characterDeletionCallback(self.selection) event.accept() -- cgit v1.2.3