[Bf-taskforce25] Saving keymaps

Brecht Van Lommel brecht at blender.org
Thu Sep 17 22:27:31 CEST 2009


Hi,

I should also mention that these methods are not mutually exclusive.
You could have an option per keymap, to say if Blender should sync
them. For example if you customize the mesh editing keymap completely,
you probably don't want it changed. But you probably still want the
graph editor keymap to be kept up to date, if you changed just one
shortcut key.

Personally I think though that syncing should be the default. I think
this is what most other apps do and what you would expect. This will
then work for the case where you just change a few items directly in
the menu. If you're going to completely customize it, you go to the
keymap editor and check the option. Though I guess the problem with
that is that no one will think of doing that until they find out it
goes wrong first. But perhaps it can be communicated somehow?

What I would like to avoid is for syncing keymaps to become sort of a
maintenance thing you have to do when upgrading Blender, to get new
tools assigned shortcut keys. If you've completely changed the layout
to what you want, that's acceptable, but if you do just a few changes,
you don't want to be bothered with it.

Brecht.

On Thu, Sep 17, 2009 at 10:07 PM, William Reynish <william at reynish.com> wrote:
> Hi Brecht,
>
> My 2 cents:
>
> As far as I'm concerned the process of making your own keymap is
> inherently a manual task, and you'll want to be sure your saved
> keymaps don't magically get changed by Blender. They need to be
> stable, if you will. They shouldn't change when Blenders keys change,
> because the whole point is that you might want to make something
> different from the defaults.
>
> I also think the ability to have multiple shortcuts to the same item
> is quite important, so going by the information you've provided it
> seems like the sanest solution to go with the manual approach.
>
> -W
>
>
> On 17 Sep, 2009, at 9:17 PM, Brecht Van Lommel wrote:
>
>> Hi,
>>
>> Ton and I had a discussion about saving keymaps. The difficulty in it
>> is syncing changes in Blender with the user edited keymaps. This could
>> be done automatic or manual.
>>
>> Manual would mean that when you have a new Blender version, you can
>> compare the default and existing keymaps, and add new Blender keys as
>> you want. The advantage of this is that nothing will be changed
>> without you knowing it, and your keymap will always be intact when
>> developers change around keys. The disadvantage is that it requires
>> manual work to do this syncing when getting a new Blender version. The
>> way this would work is by saving the full keymaps to file, which will
>> then completely override the default keymaps.
>>
>> A more automatic approach could work like this. For each default
>> keymap, a list of added and removed keymap items is stored, a kind of
>> diff. In pseudo code, a keymap lookup would work as follows:
>>
>> kmi = keymap_lookup(user_add_keymap, event)
>> if kmi:
>>       return kmi
>>
>> if keymap_lookup(user_remove_keymap, event):
>>       return NULL
>>
>> return keymap_lookup(default_keymap, event)
>>
>> The advantage of this is that it requires no manual syncing. A
>> disadvantage is that it doesn't cope well with a change in default
>> Blender shortcut keys. Say the user has changed G translate to M. Then
>> the default in Blender changes from G to ctrl+G. The result is that
>> now both ctrl+G and M do a translation. So then you can't as easily
>> take your keymap and apply it, because it depends more on the Blender
>> version.
>>
>> We could try to solve this by checking if the operator name is the
>> same, but this also fails because sometimes an operator is assigned to
>> more than one shortcut key. And then there's also operator properties
>> may be different. We could try to be a bit clever about this, but not
>> sure how well that would work. Most applications I know have just one
>> key for each operator that you can assign, but here we have a more
>> flexible situation, where you can have both gestures, keys for some
>> operator, or you might change operator properties, etc.
>>
>> Does anybody have ideas about how to do better, or about other apps
>> handling this in a good/bad way? It's kind of a general issue, suppose
>> you wanted to modify a menu, does that completely override the
>> existing one then, or do we try to be clever about syncing, accepting
>> it sometimes gives results you don't want?
>>
>> Brecht.
>> _______________________________________________
>> Bf-taskforce25 mailing list
>> Bf-taskforce25 at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-taskforce25
>
> _______________________________________________
> Bf-taskforce25 mailing list
> Bf-taskforce25 at blender.org
> http://lists.blender.org/mailman/listinfo/bf-taskforce25
>
>


More information about the Bf-taskforce25 mailing list