Skip to content

Commit

Permalink
input: Fix hyprctl switchxkblayout not actually changing layout (#7070
Browse files Browse the repository at this point in the history
)

Emits `SModifiersEvent` in `updateModifiers()`

Before the patch:

Changing layout with `hyprctl switchxkblayout ...` results in:
    * active keymap in `hyprctl devices` is changed
    * no event
    * no layout is actually changed UNTIL you press one of the mod keys
      (Alt | Shift | Super | Ctrl)

After:
    * active keymap in `hyprctl devices` changed
    * activelayout IPC event emitted
    * layout is changed

This fixes #7044
  • Loading branch information
MahouShoujoMivutilde authored Jul 27, 2024
1 parent daed752 commit 84227eb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/devices/IKeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,13 @@ void IKeyboard::updateModifiers(uint32_t depressed, uint32_t latched, uint32_t l
if (!updateModifiersState())
return;

keyboardEvents.modifiers.emit(SModifiersEvent{
.depressed = modifiersState.depressed,
.latched = modifiersState.latched,
.locked = modifiersState.locked,
.group = modifiersState.group,
});

updateLEDs();
}

Expand Down

0 comments on commit 84227eb

Please sign in to comment.