input-capture: send modifiers (highly experimental)

This commit is contained in:
Gwilherm Folliot 2024-12-17 19:20:52 +01:00
parent 6dfbcdc994
commit 21a7251d02
No known key found for this signature in database
GPG key ID: 90236D3623DCD660
3 changed files with 12 additions and 0 deletions

View file

@ -1384,6 +1384,11 @@ void CInputManager::onKeyboardMod(SP<IKeyboard> pKeyboard) {
auto MODS = pKeyboard->modifiersState;
MODS.depressed = ALLMODS;
PROTO::inputCapture->sendModifiers(MODS.depressed,MODS.latched, MODS.locked, MODS.group);
if (PROTO::inputCapture->isCaptured())
return;
const auto IME = m_sIMERelay.m_pIME.lock();
if (IME && IME->hasGrab() && !DISALLOWACTION) {

View file

@ -79,6 +79,12 @@ void CInputCaptureProtocol::sendKey(uint32_t keyCode, hyprlandInputCaptureManage
manager->sendKey(keyCode, state);
}
void CInputCaptureProtocol::sendModifiers(uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) {
for (const auto& manager : m_vManagers)
manager->sendModifiers(mods_depressed, mods_locked, mods_locked, group);
}
void CInputCaptureProtocol::sendButton(uint32_t button, hyprlandInputCaptureManagerV1ButtonState state) {
for (const auto& manager : m_vManagers)
manager->sendButton(button, state);

View file

@ -18,6 +18,7 @@ class CInputCaptureProtocol : public IWaylandProtocol {
void sendMotion(const Vector2D& absolutePosition, const Vector2D& delta);
void sendKey(uint32_t keyCode, hyprlandInputCaptureManagerV1KeyState state);
void sendModifiers(uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group);
void sendButton(uint32_t button, hyprlandInputCaptureManagerV1ButtonState state);
void sendAxis(hyprlandInputCaptureManagerV1Axis axis, double value);
void sendAxisValue120(hyprlandInputCaptureManagerV1Axis axis, int32_t value120);