mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-29 05:40:21 -04:00
opt: optimize keymap set
This commit is contained in:
parent
25067738ed
commit
bf6644c9f5
3 changed files with 7 additions and 3 deletions
|
|
@ -123,6 +123,10 @@ static const struct xkb_rule_names xkb_fallback_rules = {
|
|||
.options = NULL,
|
||||
};
|
||||
|
||||
static const struct xkb_rule_names xkb_default_rules = {
|
||||
.options = NULL,
|
||||
};
|
||||
|
||||
struct xkb_rule_names xkb_rules = {
|
||||
/* can specify fields: rules, model, layout, variant, options */
|
||||
/* example:
|
||||
|
|
|
|||
|
|
@ -865,7 +865,7 @@ int switch_keyboard_layout(const Arg *arg) {
|
|||
if (!check_keyboard_rules_validate(&rules)) {
|
||||
wlr_log(WLR_ERROR,
|
||||
"Keyboard rules validation failed, skipping layout reset");
|
||||
rules = xkb_fallback_rules;
|
||||
rules = xkb_default_rules;
|
||||
}
|
||||
|
||||
char *layout_buf = (char *)rules.layout; // 假设这是可修改的
|
||||
|
|
|
|||
|
|
@ -2377,7 +2377,7 @@ KeyboardGroup *createkeyboardgroup(void) {
|
|||
if (!check_keyboard_rules_validate(&rules)) {
|
||||
wlr_log(WLR_ERROR,
|
||||
"Keyboard rules validation failed, skipping layout reset");
|
||||
rules = xkb_fallback_rules;
|
||||
rules = xkb_default_rules;
|
||||
}
|
||||
|
||||
/* Prepare an XKB keymap and assign it to the keyboard group. */
|
||||
|
|
@ -4633,7 +4633,7 @@ void reset_keyboard_layout(void) {
|
|||
if (!check_keyboard_rules_validate(&rules)) {
|
||||
wlr_log(WLR_ERROR,
|
||||
"Keyboard rules validation failed, skipping layout reset");
|
||||
rules = xkb_fallback_rules;
|
||||
rules = xkb_default_rules;
|
||||
}
|
||||
|
||||
// Create context
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue