Fix esc key

This commit is contained in:
Florian Bruhin 2014-01-17 20:22:50 +01:00
parent 5efa56c5bb
commit 7cdad8e30d

View File

@ -1,6 +1,6 @@
from PyQt5.QtWidgets import QLineEdit, QHBoxLayout, QLabel, QWidget, QShortcut
from PyQt5.QtCore import pyqtSignal, Qt
from PyQt5.QtGui import QValidator
from PyQt5.QtGui import QValidator, QKeySequence
class StatusBar(QWidget):
def __init__(self, parent):
@ -49,9 +49,9 @@ class StatusCommand(QLineEdit):
self.setValidator(CmdValidator())
self.returnPressed.connect(self.process_cmd)
# FIXME this does not work
# FIXME this only works with real esc key, not with xmodmapped
self.esc = QShortcut(self)
self.esc.setKey(Qt.Key_Escape)
self.esc.setKey(QKeySequence(Qt.Key_Escape))
self.esc.setContext(Qt.WidgetWithChildrenShortcut)
self.esc.activated.connect(parent.setFocus)