Where can I edit keyboard shortcuts for text editing?

I described a little paper cut here: Right-Click Select — Blender Community

I checked out the Blender source code and made sure I can compile it.

Could someone give me a kickstart where to look for those keyboard shortcuts?
I would like to have a look whether that is something that would be doable for me as a first peak into the Blender source code.

Thanks :slight_smile:

3 Likes

Hm, I figured some things out myself. Most of the text handling can be configured in the Keymap.
However, this only applies for the Text Editor and the 3D Font object, not for text input widgets.

Those seem to be handled differently.

1 Like

Ok, forgot about this for a while and no had another go.
It’s here: /source/blender/editors/interface/interface_handlers.c

2 Likes

I have submitted a patch a while ago:
https://developer.blender.org/D15619

However I kinda doubt anybody has noticed it. It‘s ok, if there’s no dev time to review such a minor thing. I just wonder whether there‘s anything I need to do get it reviewed.

I have never done a patch for Blender before.

2 Likes

@Harleya two years later, I find some to time to re-visit this long lasting itch of mine, just to discover, that @ideasman42 has already implemented this. You have then disabled it:

/* TODO: Do not enable these Apple-specific modifiers until we also support them in
 * text objects, console, and text editor to keep everything consistent - Harley. */
#if defined(__APPLE__) && 0
...

May I ask why this is so important? I understand the desire to wait for consistency but would argue that step by step is better then never.

I agree, of course, text objects and the text editor would be nice follow-ups, though. The console, I could live without. The Terminal App Apple ships with Mac OS doesn’t even implement these modifiers btw. :wink:

However, if you insist, it’s better to wait until all those other editors have implemented the correct modifier keys as well, how can I help to make it happen? Is there a low hanging fruit for someone with little knowledge of the Blender codebase?

@volstock - that @ideasman42 has already implemented this. You have then disabled it…

It does look like that, but not really. In a nutshell I merged a PR that was mostly as you wrote it, adding those Mac-specific keys. Then Campbell made an improvement to it, which is what you reference. Then he and I talked about it and he really wasn’t happy with adding these while having such wildly different keyboard support between text editor, console, and text objects.

We want people to be able to move between the areas of Blender and rely on being able to use the same keys between them. So it rankled adding even more differences rather than closing the gulf.

So I reverted that change with a note that it was only until “we can add support for same for text
objects, console, and text editor. Keeping consistent between areas.”

And since that time I have done so and improved keyboard support in text objects and Console. I had hoped to revisit adding those Mac-specific keys soon, but now we are in a bit of a “Winter of Quality” project now where we are concentrating on bug fixing rather than features. So my hope is to revisit this this and get it in before February 5th so it can be part of 4.4. But possible I will miss that, depending on what else is going on.

Understood, hope you don’t feel offended or pushed :slight_smile:

If anything comes to your mind that I might help at, let me know. Maybe a quick hint where to look?

From a first glance, the text editor seems to be mostly changes to the default keymap which would I can insert some platform, switches, I think. If it’s ok for you, I could give it a go.

ok, cool, I have the text editor keymap mostly done.

I had to implement a new function txt_delete_bol() to delete to the beginning of the line.

One quirk left is that Alt + DEL inserts a weird special character. Don’t know what that’s about.

Apart from that, it’s working fine :slight_smile:

Also if you approve, what I’ve done, I should also copy it over to the industry compatible keymap.

UI Widgets
Text editor
Console
Text object

I’ll have a look, if one of the other two looks doable for me.

Done the console now.

Here is my branch:

UI Widgets
Text editor
Console
Text object

@Harleya theres a key conflict when applying these shortcuts to the 3D text object.
(Alt + Arrows = change spacing). Various applications deal differently with this same conflict (e. g. Adobe and Affinity).

What’s the best way to discuss this before implementing it? Here, in a design issue or in a pull request?

Thanks and sorry I am not very experienced when working with Git with a large amount of people.

Also I have come across a weird issue.

When I want to delete a whole word typing Alt + DEL
a weird 3-byte character is inserted?!
No clue, what that is about. Any help is much appreciated.

I saved this character to a text file: