mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-22 23:29:48 +01:00
Signed-off-by: Michael Pacheco <git@michaelpacheco.org>
This commit is contained in:
parent
deeeb33c5f
commit
cebab759d5
2 changed files with 9 additions and 4 deletions
|
@ -140,10 +140,12 @@ void CKeybindManager::updateXKBTranslationState() {
|
||||||
|
|
||||||
xkb_rule_names rules = {.rules = RULES.c_str(), .model = MODEL.c_str(), .layout = LAYOUT.c_str(), .variant = VARIANT.c_str(), .options = OPTIONS.c_str()};
|
xkb_rule_names rules = {.rules = RULES.c_str(), .model = MODEL.c_str(), .layout = LAYOUT.c_str(), .variant = VARIANT.c_str(), .options = OPTIONS.c_str()};
|
||||||
|
|
||||||
const auto PCONTEXT = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
|
const auto PCONTEXT = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
|
||||||
|
FILE* const KEYMAPFILE = fopen(FILEPATH.c_str(), "r");
|
||||||
|
|
||||||
auto PKEYMAP = FILEPATH == "" ? xkb_keymap_new_from_names(PCONTEXT, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS) :
|
auto PKEYMAP = FILEPATH == "" ? xkb_keymap_new_from_names(PCONTEXT, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS) :
|
||||||
xkb_keymap_new_from_file(PCONTEXT, fopen(FILEPATH.c_str(), "r"), XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
|
xkb_keymap_new_from_file(PCONTEXT, KEYMAPFILE, XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
|
||||||
|
fclose(KEYMAPFILE);
|
||||||
|
|
||||||
if (!PKEYMAP) {
|
if (!PKEYMAP) {
|
||||||
g_pHyprError->queueCreate("[Runtime Error] Invalid keyboard layout passed. ( rules: " + RULES + ", model: " + MODEL + ", variant: " + VARIANT + ", options: " + OPTIONS +
|
g_pHyprError->queueCreate("[Runtime Error] Invalid keyboard layout passed. ( rules: " + RULES + ", model: " + MODEL + ", variant: " + VARIANT + ", options: " + OPTIONS +
|
||||||
|
|
|
@ -786,8 +786,11 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) {
|
||||||
|
|
||||||
if (!std::filesystem::exists(path))
|
if (!std::filesystem::exists(path))
|
||||||
Debug::log(ERR, "input:kb_file= file doesnt exist");
|
Debug::log(ERR, "input:kb_file= file doesnt exist");
|
||||||
else
|
else {
|
||||||
KEYMAP = xkb_keymap_new_from_file(CONTEXT, fopen(path.c_str(), "r"), XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
|
FILE* const KEYMAPFILE = fopen(FILEPATH.c_str(), "r");
|
||||||
|
KEYMAP = xkb_keymap_new_from_file(CONTEXT, KEYMAPFILE, XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
|
||||||
|
fclose(KEYMAPFILE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!KEYMAP)
|
if (!KEYMAP)
|
||||||
|
|
Loading…
Reference in a new issue