-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Command + ArrowLeft/Right input behavior for macOS #2315
Add Command + ArrowLeft/Right input behavior for macOS #2315
Conversation
Could this also be extended to address |
|
24b9c74
to
e851526
Compare
e851526
to
5602459
Compare
6f3225d
to
e249e56
Compare
e249e56
to
8cfa814
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This PR adds macOS-specific behavior for the input and text editor for Command + ArrowLeft to behave like Home and Command + ArrowRight to behave like End to match the native behavior. This behavior is particularly useful for users with MacBooks since there aren't Home/End keys on the keyboard.
I added a new
platform::is_macos_command_pressed
function instead of usingmodifiers.command()
since the latter defaults to CTRL on other platforms and represents a jump instead of moving to the beginning/end of the line.This PR leaves out other shortcuts like Command + ArrowUp -- which would also move to the cursor to the beginning of the line for single line inputs and the beginning of the document for multi-line inputs -- to limit the scope of changes.