mirror of
https://github.com/hyprwm/hyprlock.git
synced 2026-05-09 06:18:01 +02:00
core: interpret touch as click (#788)
This commit is contained in:
parent
da1d076d84
commit
8455fc8ca6
2 changed files with 11 additions and 1 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include <chrono>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
#include <linux/input-event-codes.h>
|
||||
|
||||
CSeatManager::~CSeatManager() {
|
||||
if (m_pXKBState)
|
||||
|
|
@ -76,7 +77,15 @@ void CSeatManager::registerSeat(SP<CCWlSeat> seat) {
|
|||
g_pHyprlock->onClick(button, state == WL_POINTER_BUTTON_STATE_PRESSED, g_pHyprlock->m_vMouseLocation);
|
||||
});
|
||||
}
|
||||
|
||||
if (caps & WL_SEAT_CAPABILITY_TOUCH) {
|
||||
m_pTouch = makeShared<CCWlTouch>(r->sendGetTouch());
|
||||
m_pTouch->setDown([](CCWlTouch* r, uint32_t serial, uint32_t time, wl_proxy* surface, int32_t id, wl_fixed_t x, wl_fixed_t y) {
|
||||
g_pHyprlock->onClick(BTN_LEFT, true, {wl_fixed_to_double(x), wl_fixed_to_double(y)});
|
||||
});
|
||||
m_pTouch->setUp([](CCWlTouch* r, uint32_t serial, uint32_t time, int32_t id) {
|
||||
g_pHyprlock->onClick(BTN_LEFT, false, {0, 0});
|
||||
});
|
||||
};
|
||||
if (caps & WL_SEAT_CAPABILITY_KEYBOARD) {
|
||||
m_pKeeb = makeShared<CCWlKeyboard>(r->sendGetKeyboard());
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ class CSeatManager {
|
|||
|
||||
SP<CCWlKeyboard> m_pKeeb;
|
||||
SP<CCWlPointer> m_pPointer;
|
||||
SP<CCWlTouch> m_pTouch;
|
||||
|
||||
UP<CCursorShape> m_pCursorShape;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue