@@ -28,6 +28,10 @@ CInputCapturePortal::CInputCapturePortal(SP<CCHyprlandInputCaptureManagerV1> mgr
2828 onKeymap (format == HYPRLAND_INPUT_CAPTURE_MANAGER_V1_KEYMAP_FORMAT_XKB_V1 ? fd : 0 , size);
2929 });
3030
31+ mgr->setModifiers ([this ](CCHyprlandInputCaptureManagerV1* r, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) {
32+ onModifiers (mods_depressed, mods_latched, mods_locked, group);
33+ });
34+
3135 mgr->setKey ([this ](CCHyprlandInputCaptureManagerV1* r, uint32_t key, hyprlandInputCaptureManagerV1KeyState state) { onKey (key, state); });
3236
3337 mgr->setButton ([this ](CCHyprlandInputCaptureManagerV1* r, uint32_t button, hyprlandInputCaptureManagerV1ButtonState state) { onButton (button, state); });
@@ -321,6 +325,11 @@ void CInputCapturePortal::onKey(uint32_t id, bool pressed) {
321325 value->key (id, pressed);
322326}
323327
328+ void CInputCapturePortal::onModifiers (uint32_t modsDepressed, uint32_t modsLatched, uint32_t modsLocked, uint32_t group) {
329+ for (const auto & [key, value] : sessions)
330+ value->modifiers (modsDepressed, modsLatched, modsLocked, group);
331+ }
332+
324333void CInputCapturePortal::onKeymap (int32_t fd, uint32_t size) {
325334 keymap.fd = fd;
326335 keymap.size = size;
@@ -475,6 +484,13 @@ void CInputCapturePortal::SSession::key(uint32_t key, bool pressed) {
475484 eis->sendKey (key, pressed);
476485}
477486
487+ void CInputCapturePortal::SSession::modifiers (uint32_t modsDepressed, uint32_t modsLatched, uint32_t modsLocked, uint32_t group) {
488+ if (status != ACTIVATED)
489+ return ;
490+
491+ eis->sendModifiers (modsDepressed, modsLatched, modsLocked, group);
492+ }
493+
478494void CInputCapturePortal::SSession::button (uint32_t button, bool pressed) {
479495 if (status != ACTIVATED)
480496 return ;
0 commit comments