input_event: remove modifiersRelevantForTabBox

It was only needed because the normal modifiers path considered caps lock
as shift lock
This commit is contained in:
Xaver Hugl 2024-02-13 22:26:33 +01:00 committed by Vlad Zahorodnii
parent 8c543dbe7c
commit a917d1885e
5 changed files with 1 additions and 35 deletions

View file

@ -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

View file

@ -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;
};

View file

@ -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) {

View file

@ -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) {

View file

@ -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();