[Bf-committers] Configurable keybindings

Tom Musgrove bf-committers@blender.org
Wed, 26 May 2004 04:21:31 +0000


I'm fairly far along with the work I need to do to make it so that 
configurable keybindings can be used throughout blender.

To make it so that I can use case switches instead of if else if, i need to 
make it so that I can add G.qual (Ie LR_SHIFTKEY, LR_CTRLKEY, LR_ALTKEY, or 
combinations thereof) and Events together and not have any collisions.

The current definitions for the above these keys is in BKE_global.h

#define R_SHIFTKEY	1
#define L_SHIFTKEY	2
#define LR_SHIFTKEY 3
#define R_ALTKEY	4
#define L_ALTKEY	8
#define LR_ALTKEY	12
#define R_CTRLKEY	16
#define L_CTRLKEY	32
#define LR_CTRLKEY  48

Currently if we can have two modifiers active we do something like
G.qual == (LR_CTRLKEY | LR_ALTKEY)

which is not switch case friendly, so perhaps have something like

#define LR_CTRLKEY_AND_LR_ALTKEY
#define LR_SHIFTKEY_AND_LR_ALTKEY
#define LR_SHIFTKEY_AND_LR_CTRLKEY
#define LR_SHIFTKEY_AND_LR_CTRLKEY_AND_LR_ALTKEY
#define LR_CTRLKEY_OR_LR_ALTKEY
#define LR_CTRLKEY_AND_OR_LR_ALTKEY
etc. (about twenty of them i think?)

perhaps start at 5000 above whatever the highest event value isis and 
increment by 1000.

Then, the key combination definitions are done like

#define MAKE_PARENT (LR_CTRLKEY_AND_OR_LR_SHIFTKEY + PKEY)

and the switch case would be

case MAKE_PARENT: make_parent(); Handled = TRUE; break;

comments?

I'm making changes and seperating out drawipo.c , the toets.c, space.c and 
other files that have lots of hardcoded values. and mix key combo/event 
evaluation with function definitions.

Tom M.
LetterRip

_________________________________________________________________
MSN Toolbar provides one-click access to Hotmail from any Web page  FREE 
download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/