mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:17:35 +00:00
Base+WindowsServer+keymap: Store multiple keymaps in a config
This commit is contained in:
parent
5a31697bcf
commit
c7bd47c87c
12 changed files with 405 additions and 100 deletions
|
@ -24,10 +24,12 @@ ErrorOr<int> serenity_main(Main::Arguments)
|
|||
TRY(Core::System::unveil("/dev/keyboard0", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
auto mapper_config(Core::ConfigFile::open("/etc/Keyboard.ini"));
|
||||
auto keymap = mapper_config->read_entry("Mapping", "Keymap", "");
|
||||
auto keymaps = mapper_config->read_entry("Mapping", "Keymaps", "");
|
||||
|
||||
auto keymaps_vector = keymaps.split(',');
|
||||
|
||||
pid_t child_pid;
|
||||
const char* argv[] = { "/bin/keymap", keymap.characters(), nullptr };
|
||||
const char* argv[] = { "/bin/keymap", "-m", keymaps_vector.first().characters(), nullptr };
|
||||
if ((errno = posix_spawn(&child_pid, "/bin/keymap", nullptr, nullptr, const_cast<char**>(argv), environ))) {
|
||||
perror("posix_spawn");
|
||||
exit(1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue