UI: Text cursor behavior for Apple Devices #107522

Merged
Harley Acheson merged 1 commits from Harley/blender:MacArrows into main 2023-05-24 22:25:50 +02:00
Member

MacOS-specific behavior for arrow keys, delete, and backspace. Alt/Opt
modifier to jump by word, CMD modifier to jump to beginning/end.


Idea and code largely by @Austin-Berenyi who has closed his own PR - #106724. His original comment:

UI: Adds expected text cursor behavior for Apple Devices

macOS uses different key modifier sets from Windows for moving a text cursor in text fields. This adds that support, and keeps the previous behavior for backward compatibility.

CMD modifier jumps all
ALT/OPT modifier jumps by delimiter
modifer + SHIFT jumps and selects
This also works with DELETE and BACKSPACE events.

MacOS-specific behavior for arrow keys, delete, and backspace. Alt/Opt modifier to jump by word, CMD modifier to jump to beginning/end. --- Idea and code largely by @Austin-Berenyi who has closed his own PR - #106724. His original comment: UI: Adds expected text cursor behavior for Apple Devices macOS uses different key modifier sets from Windows for moving a text cursor in text fields. This adds that support, and keeps the previous behavior for backward compatibility. CMD modifier jumps all ALT/OPT modifier jumps by delimiter modifer + SHIFT jumps and selects This also works with DELETE and BACKSPACE events.
Harley Acheson added 1 commit 2023-05-02 02:21:27 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
407d3585a1
UI: Text cursor behavior for Apple Devices
MacOS-specific behavior for arrow keys, delete, and backspace. Alt/Opt
modifier to jump by word, CMD modifier to jump to beginning/end.
Harley Acheson requested review from Ankit Meel 2023-05-02 02:22:02 +02:00
Harley Acheson added this to the User Interface project 2023-05-02 02:22:10 +02:00
First-time contributor

@Harley thanks for resubmitting this. I wanted to let you know the only reason I closed my PR was because I was experiencing some git issues that were over my head, and felt it best to start over. But it will be quicker this way :) thanks for all your tips along the way. This was really informative and enjoyable. Hoping to contribute more in the future.

@Harley thanks for resubmitting this. I wanted to let you know the only reason I closed my PR was because I was experiencing some git issues that were over my head, and felt it best to start over. But it will be quicker this way :) thanks for all your tips along the way. This was really informative and enjoyable. Hoping to contribute more in the future.
Author
Member

@Austin-Berenyi - thanks for resubmitting this

No worries. I just didn't want to lose track of this one as it seems like something our MacOS users would appreciate.

thanks for all your tips along the way. This was really informative and enjoyable

You are very welcome. I'm glad you enjoyed it.

Hoping to contribute more in the future

Yes please!

> @Austin-Berenyi - thanks for resubmitting this No worries. I just didn't want to lose track of this one as it seems like something our MacOS users would appreciate. > thanks for all your tips along the way. This was really informative and enjoyable You are very welcome. I'm glad you enjoyed it. > Hoping to contribute more in the future Yes please!
Member

idea looks good.. I myself was bothered by the mismatch between other editors and blender code editor

Need to test it.

idea looks good.. I myself was bothered by the mismatch between other editors and blender code editor Need to test it.
Member

The behaviour of shift/noshift + command/alt + arrow is the same as before

Also, in main too, alt + delete inserts space and moves cursor to the right.. probably a different bug. Same for this PR.

I set breakpoints in edited code and main code but they don't hit..

The behaviour of shift/noshift + command/alt + arrow is the same as before Also, in main too, alt + delete inserts space and moves cursor to the right.. probably a different bug. Same for this PR. I set breakpoints in edited code and main code but they don't hit..
First-time contributor

@ankitm I believe text editor (Scripting workspace) behavior is handled by different code. You can change how the text cursor moves in the text editor in key mapping.

This pull request was originally intended to affect how the cursor behaves in text fields such as outliner names, material names, node group names, etc. It may be affecting how the cursor behaves in the text editor now.

@ankitm I believe text editor (Scripting workspace) behavior is handled by different code. You can change how the text cursor moves in the text editor in key mapping. This pull request was originally intended to affect how the cursor behaves in text fields such as outliner names, material names, node group names, etc. It may be affecting how the cursor behaves in the text editor now.
Member

Halrley's discretion needed: I feel we should change it for all kinds of text fields/ workspaces at once.

Halrley's discretion needed: I feel we should change it for all kinds of text fields/ workspaces at once.
Member

There is an element of surprise due to change in cursor behaviour in different text contexts: console, text editor and text input. But at least it addressable with keymaps. I'll try to change the blender defaults in a different PR since I have the OS available.

Also will need to add DEL_PREV_LINE also. This change works fine

There is an element of surprise due to change in cursor behaviour in different text contexts: console, text editor and text input. But at least it addressable with keymaps. I'll try to change the blender defaults in a different PR since I have the OS available. Also will need to add DEL_PREV_LINE also. This change works fine
Ankit Meel approved these changes 2023-05-08 22:37:47 +02:00
First-time contributor

@ankitm will further progress on this change happen here? Or is your plan to create an additional PR with more extensive changes? Looking forward to this!

@ankitm will further progress on this change happen here? Or is your plan to create an additional PR with more extensive changes? Looking forward to this!
Member

I've approved the functioning with caveats.. committing is up to @Harley

I've approved the functioning with caveats.. committing is up to @Harley
Author
Member

@ankitm - I've approved the functioning with caveats..

I don't have a Mac so I'm really relying on you here. My gut feeling is that if you think this PR works as advertised then I should just land it today. But that does give some pressure on you, being our Mac interaction specialist, to try to fill in any similar gaps elsewhere that you can. But we do have a fairly long development cycle with 4.0.

> @ankitm - I've approved the functioning with caveats.. I don't have a Mac so I'm really relying on you here. My gut feeling is that if you think this PR works as advertised then I should just land it today. But that does give some pressure on _you_, being our Mac interaction specialist, to try to fill in any similar gaps elsewhere that you can. But we do have a fairly long development cycle with 4.0.
Member

Please feel free to land it.. I'm okay with making the follow up changes

Please feel free to land it.. I'm okay with making the follow up changes
Author
Member

@blender-bot build

@blender-bot build
Harley Acheson merged commit 0e8419246d into main 2023-05-24 22:25:50 +02:00
Harley Acheson deleted branch MacArrows 2023-05-24 22:25:51 +02:00
Howard Trickey referenced this issue from a commit 2023-05-29 02:51:37 +02:00
First-time contributor

@Harley are there plans to reinstate these changes? I remember seeing that you temporarily removed this functionality until further work could be done in some other places of the UI.

@Harley are there plans to reinstate these changes? I remember seeing that you temporarily removed this functionality until further work could be done in some other places of the UI.
Author
Member

@Austin-Berenyi - we might be getting closer.

I think if we can get this in - #108626 - then we'll (finally) have some consistency between the various places that deal with text in Blender. And then it might the time to consider per-platform changes like this one... if those changes are for all parts of Blender. So the same per-platform shortcut has to work in UI inputs, 3D text, text editor, console. But that would then require a Mac developer.

@Austin-Berenyi - we might be getting closer. I think **if** we can get this in - https://projects.blender.org/blender/blender/pulls/108626 - then we'll (finally) have some consistency between the various places that deal with text in Blender. And then it might the time to consider per-platform changes like this one... if those changes are for all parts of Blender. So the same per-platform shortcut has to work in UI inputs, 3D text, text editor, console. But that would then require a Mac developer.
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#107522
No description provided.