feature: layout command to change between us and fr layouts

This commit is contained in:
2025-04-18 13:56:11 +02:00
parent a14cc5df28
commit 65f08e3887
5 changed files with 53 additions and 2 deletions

View File

@ -0,0 +1,19 @@
#include "keyboard.h"
#include "kprintf.h"
#include "string.h"
extern char const **keymap;
void layout_cmd(char *arg)
{
if (!strcmp(arg, "us") || !strcmp(arg, "qwerty")) {
kprintf("Successfully changed layout to us/qwerty\n");
keymap = qwerty_keymap;
} else if (!strcmp(arg, "fr") || !strcmp(arg, "azerty")) {
kprintf("Successfully changed layout to fr/azerty\n");
keymap = azerty_keymap;
} else {
kprintf(
"Invalid argument: please type us|qwerty or fr|azerty\n");
}
}