From 2843c80c5bcb38163088440470ba88ff6a76fb54 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 23 Oct 2012 20:59:27 +0200 Subject: [PATCH] xkb: use system defaults instead of "us" for layout libxkbcommon has a configure option to set the default values for the RMLVO's (if they are passed as NULL or "" - we use "" so it'd be safe to print). If they are not specified there, it's just "us" like we currently do have. But if they are specified, we should most likely defer to it. We do the same for the model field, instead of hardcoding "evdev". The rules field remains hardcoded to "evdev", because we rely on it when doing the evdev scancode-to-keycode +8 mapping. Signed-off-by: Ran Benita Signed-off-by: David Herrmann --- src/kmscon_conf.c | 4 ++-- src/uterm_input_uxkb.c | 6 +++--- tests/test_input.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/kmscon_conf.c b/src/kmscon_conf.c index 0b29731..b10c19c 100644 --- a/src/kmscon_conf.c +++ b/src/kmscon_conf.c @@ -91,7 +91,7 @@ static void print_help() "\t Size of the scrollback-buffer in lines\n" "\n" "Input Options:\n" - "\t --xkb-layout [us] Set XkbLayout for input devices\n" + "\t --xkb-layout [-] Set XkbLayout for input devices\n" "\t --xkb-variant [-] Set XkbVariant for input devices\n" "\t --xkb-options [-] Set XkbOptions for input devices\n" "\t --xkb-repeat-delay [250]\n" @@ -463,7 +463,7 @@ int kmscon_conf_new(struct conf_ctx **out) CONF_OPTION_UINT(0, "sb-size", &conf->sb_size, 1000), /* Input Options */ - CONF_OPTION_STRING(0, "xkb-layout", &conf->xkb_layout, "us"), + CONF_OPTION_STRING(0, "xkb-layout", &conf->xkb_layout, ""), CONF_OPTION_STRING(0, "xkb-variant", &conf->xkb_variant, ""), CONF_OPTION_STRING(0, "xkb-options", &conf->xkb_options, ""), CONF_OPTION_UINT(0, "xkb-repeat-delay", &conf->xkb_repeat_delay, 250), diff --git a/src/uterm_input_uxkb.c b/src/uterm_input_uxkb.c index 246abe7..dc7489e 100644 --- a/src/uterm_input_uxkb.c +++ b/src/uterm_input_uxkb.c @@ -47,7 +47,7 @@ int uxkb_desc_init(struct uterm_input *input, int ret; struct xkb_rule_names rmlvo = { .rules = "evdev", - .model = "evdev", + .model = "", .layout = layout, .variant = variant, .options = options, @@ -62,10 +62,10 @@ int uxkb_desc_init(struct uterm_input *input, input->keymap = xkb_keymap_new_from_names(input->ctx, &rmlvo, 0); if (!input->keymap) { log_warn("failed to create keymap (%s, %s, %s), " - "reverting to default US keymap", + "reverting to default system keymap", layout, variant, options); - rmlvo.layout = "us"; + rmlvo.layout = ""; rmlvo.variant = ""; rmlvo.options = ""; diff --git a/tests/test_input.c b/tests/test_input.c index 7a4e083..74a0916 100644 --- a/tests/test_input.c +++ b/tests/test_input.c @@ -160,7 +160,7 @@ static void print_help() TEST_HELP "\n" "Input Device Options:\n" - "\t --xkb-layout [us] Set XkbLayout for input devices\n" + "\t --xkb-layout [-] Set XkbLayout for input devices\n" "\t --xkb-variant [-] Set XkbVariant for input devices\n" "\t --xkb-options [-] Set XkbOptions for input devices\n", "test_input"); @@ -176,7 +176,7 @@ static void print_help() struct conf_option options[] = { TEST_OPTIONS, - CONF_OPTION_STRING(0, "xkb-layout", NULL, &input_conf.xkb_layout, "us"), + CONF_OPTION_STRING(0, "xkb-layout", NULL, &input_conf.xkb_layout, ""), CONF_OPTION_STRING(0, "xkb-variant", NULL, &input_conf.xkb_variant, ""), CONF_OPTION_STRING(0, "xkb-options", NULL, &input_conf.xkb_options, ""), }; -- 2.7.4