[Bf-committers] Keybindings plan

Kent Mein bf-committers@blender.org
Mon, 17 May 2004 12:30:09 -0500

In reply to Tom Musgrove (tommusgrove__@hotmail.com):

One thing with this, from memory so I may be wrong...

I think you said have a #define for every possible 3key combo etc that 
might be pressed.

I'd say the way to do it would be have list of  structures for every
function that can store upto 3 keys, (as well as a hardcoded default maybe)
Then we don't need yet another define for key codes just use the ones
that are already there.  Its already kind of messy because we have
blender keycodes and seperate ghost keycodes.
It Would be nice to get rid of one of them.  


> Oky,
> I've look through most of the code this weekend regarding keybindings.  
> Here is my current thoughts.
> Long term, I'd like to switch to using a hash/dictionary instead of the 
> copiously sprinkled if statements.
> The reason is multifold
> 1)  We can create a test for the scope of a key combination without knowing 
> in advance what keybindings are used for what functions and in what scope.  
> Right now, you have to know where every keybinding combination can be used, 
> and check at each level of scope to make sure that the keybinding isn't in 
> scope for a lower level.
> 2)  I'd expect a significant speed up.  Right now, at each scope test, the 
> key combo has to run a guantlet of tests completely unrelated to the 
> functions it is bound to.  This change would eliminate all of these tests 
> and instead only test for the functions specific to the key combo.
> 3)  The code should be much cleaner
> So, even if you absolutle hate the idea of custom keybindings, the above 
> reasons are adequate that the changes suggested should stand on their own 
> merit.
> However, before I get to the above, first step is to seperate some 
> unrelated bits of code out to their own files.  Toetes houses file saving 
> functions, global key binding functions, and bits of other stuff.  Then 
> switch to using the #defines as outlined in my previous email.
> Any comments or suggestions?
> Tom M.
> LetterRip
> _________________________________________________________________
> Check out the coupons and bargains on MSN Offers! http://youroffers.msn.com
> _______________________________________________
> Bf-committers mailing list
> Bf-committers@blender.org
> http://www.blender.org/mailman/listinfo/bf-committers