Standard text cursor navigation for macOS

I submitted my first PR for Blender last week which adds support for CMD and OPT key modifiers when moving the text cursor with the arrow keys on a Mac. I was given feedback on my proposal. Here is the PR for reference:

UI: Adds expected text cursor behavior for Apple Devices

I’m new to Blender development. Can I get some help understanding this particular point of feedback that Harley Acheson gave me? I appreciate his advice, but I may need some additional detail for how to accomplish it.

It is my understanding (possibly wrong) that for all platforms the modifier to select while using arrow keys is shift, so the only thing you really need to change for Mac is for the eStrCursorJumpType argument, so you should be able to get by with a single ui_textedit_move here. Rather than put the “if” in your platform defines you could put the assignment of a eStrCursorJumpType variable. Then use that as an argument to ui_textedit_move.

You can ask Harley for clarification in the pull request, easier to keep the discussion in one place.

1 Like