Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.8.0
-
None
Description
I have remapped keys with xmodmap, and those are taken into account by all applications except the ones that use Qt5.8.
My xmodmap command is :
xmodmap \ -e 'clear Control' \ -e 'keycode 37 = n' \ -e 'keycode 57 = Control_L' \ -e 'add Control = Control_L'
It swaps the key `n` with the `Control_L` key.
Here is a test script (in Python)
#!/usr/bin/env python3 from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QHBoxLayout class KeyWidget(QWidget): 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): lines = [ 'key: 0x{:x}'.format(int(e.key())), 'modifiers: 0x{:x}'.format(int(e.modifiers())), 'text: {!r}'.format(e.text()), ] self._label.setText('\n'.join(lines)) app = QApplication([]) w = KeyWidget() w.show() app.exec_()
However, I get following results :
If I hit the key n on my keyboard :
N
key: 0x4e
modifiers: 0x0
text: 'n'
If I hit the left ctrl key :
None key: 0x1000021 modifiers: 0x4000000 text: ''
And If I hit n and b at the same time (n then b , without releasing n)
Ctrl+B
key: 0x42
modifiers: 0x4000000
text: '\x02'
This issue was first opened here : https://github.com/qutebrowser/qutebrowser/issues/2350#issuecomment-282592037
But since it seems to be a Qt issue, I open it here now
Attachments
Issue Links
- relates to
-
QTBUG-59064 Unable to type double and single quotes in QtCreator on Xubuntu 16.04
- Closed