Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0552edaf3 |
@@ -108,6 +108,14 @@ class GraphicsView(QGraphicsView):
|
|||||||
textFromCode = 'enter'
|
textFromCode = 'enter'
|
||||||
elif code == 16777217:
|
elif code == 16777217:
|
||||||
textFromCode = 'tab'
|
textFromCode = 'tab'
|
||||||
|
elif code == 16777219:
|
||||||
|
textFromCode = 'backspace'
|
||||||
|
elif code == 16777223:
|
||||||
|
textFromCode = 'delete'
|
||||||
|
elif code == 16777216:
|
||||||
|
textFromCode = 'esc'
|
||||||
|
elif code == 32:
|
||||||
|
textFromCode = 'space'
|
||||||
else:
|
else:
|
||||||
textFromCode = chr(code)
|
textFromCode = chr(code)
|
||||||
except :
|
except :
|
||||||
@@ -130,9 +138,15 @@ class GraphicsView(QGraphicsView):
|
|||||||
if(pressedModifiers & Qt.AltModifier):
|
if(pressedModifiers & Qt.AltModifier):
|
||||||
modifierTextList.append('alt')
|
modifierTextList.append('alt')
|
||||||
if(pressedModifiers & Qt.ControlModifier):
|
if(pressedModifiers & Qt.ControlModifier):
|
||||||
|
if sys.platform == 'darwin': # macOS
|
||||||
modifierTextList.append('cmd') # on the mac this is the command key
|
modifierTextList.append('cmd') # on the mac this is the command key
|
||||||
|
else: # Linux and Windows
|
||||||
|
modifierTextList.append('ctrl')
|
||||||
if(pressedModifiers & Qt.MetaModifier):
|
if(pressedModifiers & Qt.MetaModifier):
|
||||||
modifierTextList.append('ctrl')# on the mac this is the control key
|
if sys.platform == 'darwin': # macOS
|
||||||
|
modifierTextList.append('ctrl') # on the mac this is the control key
|
||||||
|
else: # Linux and Windows
|
||||||
|
modifierTextList.append('win')
|
||||||
|
|
||||||
return modifierTextList
|
return modifierTextList
|
||||||
|
|
||||||
@@ -629,11 +643,15 @@ class App(QWidget):
|
|||||||
if(pressedModifiers & Qt.AltModifier):
|
if(pressedModifiers & Qt.AltModifier):
|
||||||
modifierTextList.append('alt')
|
modifierTextList.append('alt')
|
||||||
if(pressedModifiers & Qt.ControlModifier):
|
if(pressedModifiers & Qt.ControlModifier):
|
||||||
#modifierTextList.append('ctrl')
|
if sys.platform == 'darwin': # macOS
|
||||||
modifierTextList.append('cmd') # on the mac this is the command key
|
modifierTextList.append('cmd') # on the mac this is the command key
|
||||||
|
else: # Linux and Windows
|
||||||
|
modifierTextList.append('ctrl')
|
||||||
if(pressedModifiers & Qt.MetaModifier):
|
if(pressedModifiers & Qt.MetaModifier):
|
||||||
modifierTextList.append('ctrl')# on the mac this is the control key
|
if sys.platform == 'darwin': # macOS
|
||||||
#modifierTextList.append('win')
|
modifierTextList.append('ctrl') # on the mac this is the control key
|
||||||
|
else: # Linux and Windows
|
||||||
|
modifierTextList.append('win')
|
||||||
return set(modifierTextList) == set(self.currentInputModifiers)
|
return set(modifierTextList) == set(self.currentInputModifiers)
|
||||||
|
|
||||||
def simplifyModifierList(self, modifierList):
|
def simplifyModifierList(self, modifierList):
|
||||||
|
|||||||
Reference in New Issue
Block a user