summaryrefslogtreecommitdiff
path: root/src/devices/IKeyboard.hpp
diff options
context:
space:
mode:
authorSungyoon Cho <sungyoon@sungyooncho.dev>2024-07-28 19:46:38 +0900
committerGitHub <noreply@github.com>2024-07-28 11:46:38 +0100
commit9b6ae4f77b95fef271c2e21abba5e05b4cc47719 (patch)
tree6ffe52a271da61803684009ae6697f8ad5bb1b3b /src/devices/IKeyboard.hpp
parentbc86afea7e177a7ad4335737417fc0e468698dc4 (diff)
input: fix keyboard leds with multiple keyboards (#7079)
Diffstat (limited to 'src/devices/IKeyboard.hpp')
-rw-r--r--src/devices/IKeyboard.hpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/devices/IKeyboard.hpp b/src/devices/IKeyboard.hpp
index 2ff8a190..ad8eaf7e 100644
--- a/src/devices/IKeyboard.hpp
+++ b/src/devices/IKeyboard.hpp
@@ -5,6 +5,7 @@
#include "../macros.hpp"
#include "../helpers/math/Math.hpp"
+#include <optional>
#include <xkbcommon/xkbcommon.h>
AQUAMARINE_FORWARD(IKeyboard);
@@ -61,19 +62,20 @@ class IKeyboard : public IHID {
std::string rules = "";
};
- void setKeymap(const SStringRuleNames& rules);
- void updateXKBTranslationState(xkb_keymap* const keymap = nullptr);
- std::string getActiveLayout();
- void updateLEDs();
- void updateLEDs(uint32_t leds);
- uint32_t getModifiers();
- void updateModifiers(uint32_t depressed, uint32_t latched, uint32_t locked, uint32_t group);
- bool updateModifiersState(); // rets whether changed
- void updateXkbStateWithKey(uint32_t xkbKey, bool pressed);
- void updateKeymapFD();
-
- bool active = false;
- bool enabled = true;
+ void setKeymap(const SStringRuleNames& rules);
+ void updateXKBTranslationState(xkb_keymap* const keymap = nullptr);
+ std::string getActiveLayout();
+ std::optional<uint32_t> getLEDs();
+ void updateLEDs();
+ void updateLEDs(uint32_t leds);
+ uint32_t getModifiers();
+ void updateModifiers(uint32_t depressed, uint32_t latched, uint32_t locked, uint32_t group);
+ bool updateModifiersState(); // rets whether changed
+ void updateXkbStateWithKey(uint32_t xkbKey, bool pressed);
+ void updateKeymapFD();
+
+ bool active = false;
+ bool enabled = true;
// if the keymap is overridden by the implementation,
// don't try to set keyboard rules anymore, to avoid overwriting the requested one.