mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-01 07:07:49 +00:00
KeyboardSettings: Add checkbox to enable Caps Lock mapping to Ctrl
This patch adds an additional control to KeyboardSettings allowing the user to map Caps Lock to Ctrl. Previously, this was only possible by writing to /sys/kernel/variables/caps_lock_to_ctrl. Writing to /sys/kernel/variables/caps_lock_to_ctrl requires root privileges, but KeyboardSettings will not attempt to elevate the privilege of the user if they are not root. Instead, the checkbox is rendered as un-editable.
This commit is contained in:
parent
07b83cf3fa
commit
9e21b3f216
Notes:
sideshowbarker
2024-07-17 00:23:42 +09:00
Author: https://github.com/sbcohen2000 🔰
Commit: 9e21b3f216
Pull-request: https://github.com/SerenityOS/serenity/pull/17005
Reviewed-by: https://github.com/trflynn89 ✅
4 changed files with 53 additions and 0 deletions
|
@ -27,7 +27,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::pledge("stdio rpath recvfd sendfd proc exec"));
|
||||
TRY(Core::System::unveil("/res", "r"));
|
||||
TRY(Core::System::unveil("/bin/keymap", "x"));
|
||||
TRY(Core::System::unveil("/bin/sysctl", "x"));
|
||||
TRY(Core::System::unveil("/sys/kernel/keymap", "r"));
|
||||
TRY(Core::System::unveil("/sys/kernel/variables/caps_lock_to_ctrl", "r"));
|
||||
TRY(Core::System::unveil("/etc/Keyboard.ini", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue