input_event: remove modifiersRelevantForTabBox
It was only needed because the normal modifiers path considered caps lock as shift lock
This commit is contained in:
parent
8c543dbe7c
commit
a917d1885e
5 changed files with 1 additions and 35 deletions
|
@ -1616,7 +1616,7 @@ public:
|
|||
passToWaylandServer(event);
|
||||
|
||||
if (event->type() == QEvent::KeyPress) {
|
||||
workspace()->tabbox()->keyPress(event->modifiersRelevantForTabBox() | event->key());
|
||||
workspace()->tabbox()->keyPress(event->modifiers() | event->key());
|
||||
} else if (static_cast<KeyEvent *>(event)->modifiersRelevantForGlobalShortcuts() == Qt::NoModifier) {
|
||||
workspace()->tabbox()->modifiersReleased();
|
||||
// update keyboard facus if the tabbox no longer grabs keys
|
||||
|
|
|
@ -150,22 +150,11 @@ public:
|
|||
m_modifiersRelevantForShortcuts = mods;
|
||||
}
|
||||
|
||||
Qt::KeyboardModifiers modifiersRelevantForTabBox() const
|
||||
{
|
||||
return m_modifiersRelevantForTabBox;
|
||||
}
|
||||
|
||||
void setModifiersRelevantForTabBox(const Qt::KeyboardModifiers &mods)
|
||||
{
|
||||
m_modifiersRelevantForTabBox = mods;
|
||||
}
|
||||
|
||||
std::chrono::microseconds timestamp() const;
|
||||
|
||||
private:
|
||||
InputDevice *m_device;
|
||||
Qt::KeyboardModifiers m_modifiersRelevantForShortcuts = Qt::KeyboardModifiers();
|
||||
Qt::KeyboardModifiers m_modifiersRelevantForTabBox = Qt::KeyboardModifiers();
|
||||
const std::chrono::microseconds m_timestamp;
|
||||
};
|
||||
|
||||
|
|
|
@ -256,7 +256,6 @@ void KeyboardInputRedirection::processKey(uint32_t key, InputRedirection::Keyboa
|
|||
time,
|
||||
device);
|
||||
event.setModifiersRelevantForGlobalShortcuts(globalShortcutsModifiers);
|
||||
event.setModifiersRelevantForTabBox(m_xkb->modifiersRelevantForTabBox());
|
||||
|
||||
m_input->processSpies(std::bind(&InputEventSpy::keyEvent, std::placeholders::_1, &event));
|
||||
if (!m_inited) {
|
||||
|
|
21
src/xkb.cpp
21
src/xkb.cpp
|
@ -552,27 +552,6 @@ Qt::KeyboardModifiers Xkb::modifiersRelevantForGlobalShortcuts(uint32_t scanCode
|
|||
return mods & ~consumedMods;
|
||||
}
|
||||
|
||||
Qt::KeyboardModifiers Xkb::modifiersRelevantForTabBox() const
|
||||
{
|
||||
if (!m_state) {
|
||||
return Qt::NoModifier;
|
||||
}
|
||||
Qt::KeyboardModifiers mods = Qt::NoModifier;
|
||||
if (xkb_state_mod_index_is_active(m_state, m_shiftModifier, XKB_STATE_MODS_EFFECTIVE) == 1) {
|
||||
mods |= Qt::ShiftModifier;
|
||||
}
|
||||
if (xkb_state_mod_index_is_active(m_state, m_altModifier, XKB_STATE_MODS_EFFECTIVE) == 1) {
|
||||
mods |= Qt::AltModifier;
|
||||
}
|
||||
if (xkb_state_mod_index_is_active(m_state, m_controlModifier, XKB_STATE_MODS_EFFECTIVE) == 1) {
|
||||
mods |= Qt::ControlModifier;
|
||||
}
|
||||
if (xkb_state_mod_index_is_active(m_state, m_metaModifier, XKB_STATE_MODS_EFFECTIVE) == 1) {
|
||||
mods |= Qt::MetaModifier;
|
||||
}
|
||||
return mods;
|
||||
}
|
||||
|
||||
xkb_keysym_t Xkb::toKeysym(uint32_t key)
|
||||
{
|
||||
if (!m_state) {
|
||||
|
|
|
@ -58,7 +58,6 @@ public:
|
|||
bool superAsMeta = false) const;
|
||||
Qt::KeyboardModifiers modifiers() const;
|
||||
Qt::KeyboardModifiers modifiersRelevantForGlobalShortcuts(uint32_t scanCode = 0) const;
|
||||
Qt::KeyboardModifiers modifiersRelevantForTabBox() const;
|
||||
bool shouldKeyRepeat(quint32 key) const;
|
||||
|
||||
void switchToNextLayout();
|
||||
|
|
Loading…
Reference in a new issue