Commit e67b3571 authored by Paul Tvete's avatar Paul Tvete
Browse files

Fake a shift modifier when we detect CapsLock

Slightly hacky, but Wayland only handles keycodes and modifiers
in wl_keyboard, so the text is ignored.
parent c818ea57
......@@ -139,6 +139,10 @@ void QVncItem::createServer()
Qt::Key key,
Qt::KeyboardModifiers keyboardModifiers,
const QChar &text){
if (!text.isNull() && text.isLetter() && text.isUpper() != !!(keyboardModifiers & Qt::ShiftModifier)) {
// We probably have CapsLock: flip the shift state so that Wayland can handle it
keyboardModifiers ^= Qt::ShiftModifier;
}
QKeyEvent ke(eventType, key, keyboardModifiers, text.isNull() ? QString{} : QString{text} );
QVncItem::handleKey(&ke);
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment