summaryrefslogtreecommitdiff
path: root/src/devices/IKeyboard.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-03-20 13:52:37 -0400
committerGitHub <noreply@github.com>2026-03-20 17:52:37 +0000
commit8726a7363eb9213235e6e23657668e0daac39a5b (patch)
tree42eeb40f6f81a9ccec1455f308e56173e9dcce4b /src/devices/IKeyboard.cpp
parentb940b0d2c197841b0f648598ee782dbaf9e0a89b (diff)
config: cleanup the entire config infrastructure (#13785)
Massively refactors the config infrastructure, sorely needed and will be req'd for the lua stuff
Diffstat (limited to 'src/devices/IKeyboard.cpp')
-rw-r--r--src/devices/IKeyboard.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/devices/IKeyboard.cpp b/src/devices/IKeyboard.cpp
index ae6df1f5..fde28324 100644
--- a/src/devices/IKeyboard.cpp
+++ b/src/devices/IKeyboard.cpp
@@ -1,14 +1,17 @@
#include "IKeyboard.hpp"
#include "../defines.hpp"
-#include "../helpers/varlist/VarList.hpp"
+#include "../config/legacy/ConfigManager.hpp"
#include "../managers/input/InputManager.hpp"
#include "../managers/SeatManager.hpp"
-#include "../config/ConfigManager.hpp"
+#include "../helpers/MiscFunctions.hpp"
+#include "../hyprerror/HyprError.hpp"
#include <sys/mman.h>
#include <aquamarine/input/Input.hpp>
+#include <hyprutils/string/VarList.hpp>
#include <cstring>
using namespace Hyprutils::OS;
+using namespace Hyprutils::String;
#define LED_COUNT 3
@@ -82,7 +85,7 @@ void IKeyboard::setKeymap(const SStringRuleNames& rules) {
rules.model, rules.options);
if (!m_xkbFilePath.empty()) {
- auto path = absolutePath(m_xkbFilePath, g_pConfigManager->m_configCurrentPath);
+ auto path = absolutePath(m_xkbFilePath, Config::mgr()->currentConfigPath());
if (FILE* const KEYMAPFILE = fopen(path.c_str(), "r"); !KEYMAPFILE)
Log::logger->log(Log::ERR, "Cannot open input:kb_file= file for reading");
@@ -96,8 +99,8 @@ void IKeyboard::setKeymap(const SStringRuleNames& rules) {
m_xkbKeymap = xkb_keymap_new_from_names2(CONTEXT, &XKBRULES, XKB_KEYMAP_FORMAT_TEXT_V2, XKB_KEYMAP_COMPILE_NO_FLAGS);
if (!m_xkbKeymap) {
- g_pConfigManager->addParseError("Invalid keyboard layout passed. ( rules: " + rules.rules + ", model: " + rules.model + ", variant: " + rules.variant +
- ", options: " + rules.options + ", layout: " + rules.layout + " )");
+ g_pHyprError->queueError("Invalid keyboard layout passed. ( rules: " + rules.rules + ", model: " + rules.model + ", variant: " + rules.variant +
+ ", options: " + rules.options + ", layout: " + rules.layout + " )");
Log::logger->log(Log::ERR, "Keyboard layout {} with variant {} (rules: {}, model: {}, options: {}) couldn't have been loaded.", rules.layout, rules.variant, rules.rules,
rules.model, rules.options);
@@ -114,7 +117,7 @@ void IKeyboard::setKeymap(const SStringRuleNames& rules) {
updateXKBTranslationState(m_xkbKeymap);
- const auto NUMLOCKON = g_pConfigManager->getDeviceInt(m_hlName, "numlock_by_default", "input:numlock_by_default");
+ const auto NUMLOCKON = Config::mgr()->getDeviceInt(m_hlName, "numlock_by_default", "input:numlock_by_default");
if (NUMLOCKON == 1) {
// lock numlock