mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-07 22:05:58 +01:00
parent
8ca28dd510
commit
4dc07c4378
1 changed files with 18 additions and 12 deletions
|
@ -335,15 +335,15 @@ bool CKeybindManager::onKeyEvent(wlr_keyboard_key_event* e, SKeyboard* pKeyboard
|
||||||
.submapAtPress = m_szCurrentSelectedSubmap,
|
.submapAtPress = m_szCurrentSelectedSubmap,
|
||||||
};
|
};
|
||||||
|
|
||||||
bool suppressEvent = false;
|
|
||||||
if (e->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
|
|
||||||
// clean repeat
|
|
||||||
if (m_pActiveKeybindEventSource) {
|
if (m_pActiveKeybindEventSource) {
|
||||||
wl_event_source_remove(m_pActiveKeybindEventSource);
|
wl_event_source_remove(m_pActiveKeybindEventSource);
|
||||||
m_pActiveKeybindEventSource = nullptr;
|
m_pActiveKeybindEventSource = nullptr;
|
||||||
m_pActiveKeybind = nullptr;
|
m_pActiveKeybind = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool suppressEvent = false;
|
||||||
|
if (e->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
|
||||||
|
|
||||||
m_dPressedKeys.push_back(KEY);
|
m_dPressedKeys.push_back(KEY);
|
||||||
|
|
||||||
suppressEvent = handleKeybinds(MODS, KEY, true);
|
suppressEvent = handleKeybinds(MODS, KEY, true);
|
||||||
|
@ -353,12 +353,6 @@ bool CKeybindManager::onKeyEvent(wlr_keyboard_key_event* e, SKeyboard* pKeyboard
|
||||||
|
|
||||||
m_dPressedKeys.back().sent = !suppressEvent;
|
m_dPressedKeys.back().sent = !suppressEvent;
|
||||||
} else { // key release
|
} else { // key release
|
||||||
// clean repeat
|
|
||||||
if (m_pActiveKeybindEventSource) {
|
|
||||||
wl_event_source_remove(m_pActiveKeybindEventSource);
|
|
||||||
m_pActiveKeybindEventSource = nullptr;
|
|
||||||
m_pActiveKeybind = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool foundInPressedKeys = false;
|
bool foundInPressedKeys = false;
|
||||||
for (auto it = m_dPressedKeys.begin(); it != m_dPressedKeys.end();) {
|
for (auto it = m_dPressedKeys.begin(); it != m_dPressedKeys.end();) {
|
||||||
|
@ -396,6 +390,12 @@ bool CKeybindManager::onAxisEvent(wlr_pointer_axis_event* e) {
|
||||||
|
|
||||||
m_tScrollTimer.reset();
|
m_tScrollTimer.reset();
|
||||||
|
|
||||||
|
if (m_pActiveKeybindEventSource) {
|
||||||
|
wl_event_source_remove(m_pActiveKeybindEventSource);
|
||||||
|
m_pActiveKeybindEventSource = nullptr;
|
||||||
|
m_pActiveKeybind = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
if (e->source == WL_POINTER_AXIS_SOURCE_WHEEL && e->orientation == WL_POINTER_AXIS_VERTICAL_SCROLL) {
|
if (e->source == WL_POINTER_AXIS_SOURCE_WHEEL && e->orientation == WL_POINTER_AXIS_VERTICAL_SCROLL) {
|
||||||
if (e->delta < 0)
|
if (e->delta < 0)
|
||||||
|
@ -433,6 +433,12 @@ bool CKeybindManager::onMouseEvent(wlr_pointer_button_event* e) {
|
||||||
.modmaskAtPressTime = MODS,
|
.modmaskAtPressTime = MODS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (m_pActiveKeybindEventSource) {
|
||||||
|
wl_event_source_remove(m_pActiveKeybindEventSource);
|
||||||
|
m_pActiveKeybindEventSource = nullptr;
|
||||||
|
m_pActiveKeybind = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
if (e->state == WL_POINTER_BUTTON_STATE_PRESSED) {
|
if (e->state == WL_POINTER_BUTTON_STATE_PRESSED) {
|
||||||
m_dPressedKeys.push_back(KEY);
|
m_dPressedKeys.push_back(KEY);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue