[Bf-taskforce25] Saving keymaps

William Reynish william at reynish.com
Thu Sep 17 22:07:57 CEST 2009


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



More information about the Bf-taskforce25 mailing list