[Bf-committers] I've made a custom hotkey system for Blender!

joeedh joeeagar at prodigy.net
Mon Dec 6 07:10:08 CET 2004


joeedh wrote:

> IF THIS IS NOT ALREADY BEING WORKED ON (don't you just hate all caps):
>
[INSERT oops not clear] I've implemented a custom hotkey keybinding 
system as such:

> I added a char keybinding[24][3] member to the user def struct.  For 
> each member of the array, [0] is the key code, [1] is NULL (because 
> the UI expects null-terminated strings) and [2] is the qualifyer  for 
> it (such as shift, alt, whatever, based on the values in BKE_global.h).

>
> I did this for simpicity, and because I already have two new structs 
> in my Blender DNA, one new Library block type, and I don't wish to 
> further pollute the DNA code with even more structs.
>
> And I've written the UI for it, in the Themes buttons.  Under the 
> spacetype menu I've added a "keybinding" entry.  Oh, and I've of 
> course written the appropiate functions for it, for seeing if a 
> particular hotkey has been pressed, etc.
>
> But before I start digging into the latest CVS download to redo all 
> the hotkey calls (hopefully with LetterRip's help, since he kindly 
> offered his assistance on IRC), I must know, Ton, if you hate my 
> solution ;).
>
> Oh, each hotkey-pressed-tester function does a check on the hotkey to 
> see if key[0] (the keycode) is equal to 0; if so, then it sets it to a 
> default value.  If you were wondering about backward compatibility.
>
> joeedh
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
>



More information about the Bf-committers mailing list