Add minimal key tester script.

See #658.
This commit is contained in:
Florian Bruhin 2015-05-12 09:02:17 +02:00
parent d9655f5eb9
commit c88393ccfd

23
scripts/keytester.py Normal file
View File

@ -0,0 +1,23 @@
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QHBoxLayout
from qutebrowser.utils import utils
class KeyWidget(QWidget):
"""Widget displaying key presses."""
def __init__(self, parent=None):
super().__init__(parent)
self._layout = QHBoxLayout(self)
self._label = QLabel(text="Waiting for keypress...")
self._layout.addWidget(self._label)
def keyPressEvent(self, e):
self._label.setText(utils.keyevent_to_string(e))
app = QApplication([])
w = KeyWidget()
w.show()
app.exec_()