mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
Kernel: Implement AltGr key support
This commit is contained in:
parent
36f1de3c89
commit
624116a8b1
Notes:
sideshowbarker
2024-07-19 10:30:34 +09:00
Author: https://github.com/xTibor
Commit: 624116a8b1
Pull-request: https://github.com/SerenityOS/serenity/pull/972
6 changed files with 36 additions and 15 deletions
|
@ -3584,19 +3584,24 @@ int Process::sys$getrandom(void* buffer, size_t buffer_size, unsigned int flags
|
|||
return 0;
|
||||
}
|
||||
|
||||
int Process::sys$setkeymap(char* map, char* shift_map, char* alt_map)
|
||||
int Process::sys$setkeymap(const Syscall::SC_setkeymap_params* params)
|
||||
{
|
||||
if (!is_superuser())
|
||||
return -EPERM;
|
||||
|
||||
if (!validate_read(map, 0x80))
|
||||
return -EFAULT;
|
||||
if (!validate_read(shift_map, 0x80))
|
||||
return -EFAULT;
|
||||
if (!validate_read(alt_map, 0x80))
|
||||
if (!validate_read_typed(params))
|
||||
return -EFAULT;
|
||||
|
||||
KeyboardDevice::the().set_maps(map, shift_map, alt_map);
|
||||
if (!validate_read(params->map, 0x80))
|
||||
return -EFAULT;
|
||||
if (!validate_read(params->shift_map, 0x80))
|
||||
return -EFAULT;
|
||||
if (!validate_read(params->alt_map, 0x80))
|
||||
return -EFAULT;
|
||||
if (!validate_read(params->altgr_map, 0x80))
|
||||
return -EFAULT;
|
||||
|
||||
KeyboardDevice::the().set_maps(params->map, params->shift_map, params->alt_map, params->altgr_map);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue