aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fbcon.c30
-rw-r--r--kbd.c28
-rw-r--r--kbd.h2
3 files changed, 30 insertions, 30 deletions
diff --git a/fbcon.c b/fbcon.c
index db76b85..c63c47f 100644
--- a/fbcon.c
+++ b/fbcon.c
@@ -186,36 +186,6 @@ static void console_switch_resume(void)
/* ---------------------------------------------------------------------- */
-static void xkb_configure(void)
-{
- char line[128], *m, *v, *h;
- FILE *fp;
-
- fp = fopen("/etc/vconsole.conf", "r");
- if (!fp)
- return;
- while (fgets(line, sizeof(line), fp)) {
- if (strncmp(line, "KEYMAP=", 7) != 0)
- continue;
- m = line + 7;
- if (*m == '"')
- m++;
- if ((h = strchr(m, '\n')) != NULL)
- *h = 0;
- if ((h = strchr(m, '"')) != NULL)
- *h = 0;
- v = strchr(m, '-');
- if (v) {
- *(v++) = 0;
- xkb_layout.variant = strdup(v);
- }
- xkb_layout.layout = strdup(m);
- }
- fclose(fp);
-}
-
-/* ---------------------------------------------------------------------- */
-
struct color {
float r;
float g;
diff --git a/kbd.c b/kbd.c
index 9dd8241..7290d46 100644
--- a/kbd.c
+++ b/kbd.c
@@ -26,6 +26,34 @@ struct xkb_rule_names xkb_layout = {
.options = NULL,
};
+void xkb_configure(void)
+{
+ char line[128], *m, *v, *h;
+ FILE *fp;
+
+ fp = fopen("/etc/vconsole.conf", "r");
+ if (!fp)
+ return;
+ while (fgets(line, sizeof(line), fp)) {
+ if (strncmp(line, "KEYMAP=", 7) != 0)
+ continue;
+ m = line + 7;
+ if (*m == '"')
+ m++;
+ if ((h = strchr(m, '\n')) != NULL)
+ *h = 0;
+ if ((h = strchr(m, '"')) != NULL)
+ *h = 0;
+ v = strchr(m, '-');
+ if (v) {
+ *(v++) = 0;
+ xkb_layout.variant = strdup(v);
+ }
+ xkb_layout.layout = strdup(m);
+ }
+ fclose(fp);
+}
+
/* ---------------------------------------------------------------------- */
struct termctrl {
diff --git a/kbd.h b/kbd.h
index 82130a0..beb5bfb 100644
--- a/kbd.h
+++ b/kbd.h
@@ -18,6 +18,8 @@ extern struct xkb_keymap *xkb_map;
extern struct xkb_state *xkb_state;
extern struct xkb_rule_names xkb_layout;
+void xkb_configure(void);
+
void kbd_init(int use_libinput, dev_t gfx);
int kbd_wait(int timeout);
int kbd_read(char *buf, uint32_t len,