[Bf-taskforce25] Saving keymaps

Jeroen Bakker j.bakker at atmind.nl
Thu Sep 17 22:28:41 CEST 2009


Hi,

interesting topic.
issue occurs when installing new blender version (probably only several 
times a year). most systems has a default map and a user defined map. 
When the default map changes (new functionality) you have to solve it. 
IMO the system must be intelligent enough to detect the errors, but 
should never change it.

some tools have options to display all mapped functions on a virtual 
keyboard. This allows the user simply determine:
a. if new functionalities exist or changed in the default map
b. if collisions exist in the keymap
c. give insight to what key does what. (when user one uses the system of 
another user.) or just for documentation.

When keys changes and it is not expected it not good for the reputation 
of the system. The user must decide what has to be done, the system can 
only help with this.

You could investigate a different implementation:
activemap=defaultmap+usermap
where the default map is saved in the blender binary, the usermap in the 
user settings and the activemap only recites in memory. The defaultmap 
and usermap is ordered by functionality and not by key for easier 
configuration. only the activemap is ordered at key-code for quick 
lookup. the usermap only contains changes to the defaultmap. do not save 
the complete map as the possibility can occur that new functionality is 
not accessible.

And what about tutorials: perhaps it should be possible to temporarily 
turn off the usermap. being:
activemap=defaultmap

Jeroen.

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