mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibWeb: Re-assign cmd+arrow key events to home/end keys on macOS
In text documents, pressing the left/right arrow keys with the cmd key pressed should be treated as home/end key presses.
This commit is contained in:
parent
a0072f422a
commit
bf9d05d97a
|
|
@ -929,6 +929,19 @@ bool EventHandler::handle_keydown(UIEvents::KeyCode key, u32 modifiers, u32 code
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(AK_OS_MACOS)
|
||||||
|
if ((modifiers & UIEvents::Mod_Super) != 0) {
|
||||||
|
if (key == UIEvents::KeyCode::Key_Left) {
|
||||||
|
key = UIEvents::KeyCode::Key_Home;
|
||||||
|
modifiers &= ~UIEvents::Mod_Super;
|
||||||
|
}
|
||||||
|
if (key == UIEvents::KeyCode::Key_Right) {
|
||||||
|
key = UIEvents::KeyCode::Key_End;
|
||||||
|
modifiers &= ~UIEvents::Mod_Super;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (key == UIEvents::KeyCode::Key_Left || key == UIEvents::KeyCode::Key_Right) {
|
if (key == UIEvents::KeyCode::Key_Left || key == UIEvents::KeyCode::Key_Right) {
|
||||||
auto increment_or_decrement_cursor = [&]() {
|
auto increment_or_decrement_cursor = [&]() {
|
||||||
if ((modifiers & UIEvents::Mod_PlatformWordJump) == 0) {
|
if ((modifiers & UIEvents::Mod_PlatformWordJump) == 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user