[Bf-funboard] Command Line
Tom Musgrove
bf-funboard@blender.org
Sun, 30 May 2004 18:46:42 +0000
Hi Janek,
I'm currently seperating the keybinding definitions from the event
evaluation and function definitions.
The format I currently have is
EVENT_DESCRIPTION SPACE_TYPE MODE_TYPE SUB_MODE
PRIMARY_KEY QUALIFIER_KEY(S) FUNCTION_NAME
A lot of functions have the qualiifier keys deeply mixed in the function
definition.
Similarly most of the event ques have a few function definitions in them.
For the keybindings.h I have
//Space Type Scope
//Mode Type Scope
//Sub Mode Scope
#define EVENT_DESCRIPTION (PRIMARY_KEY+QUALIFIER_KEY1+QUALIFIER_KEY2)
or if it is a key combination that has a similar effect in different spaces
and modes, you can have
#define UNIFIED_EVENT_DESCRIPTION
(PRIMARY_KEY_QUALIFIER_KEY1+QUALIFIER_KEY2)
then have
#define EVENT_DESCRIPTION UNIFIED_EVENT_DESCRIPTION
And then in the event evaluation loop I have
switch(SPACE_TYPE) {
case (SPACE_TYPE1) { space_type1_event_handler()}
}
then in space_type1_event_handler() I have
{
if(MODE_TYPE) {
if(SUBMODE_TYPE) {
switch(EVENT_DESCRIPTION) {
case EVENT_DESCRIPTION1: FUNCTION_NAME(); HANDLED =
true; break;
case EVENT_DESCRIPTION2: FUNCTION_NAME2(); HANDLED =
true; break;
}
}
}
if(!HANDLED) {
global_handler();
}
etc.
if the global handler doesn't handle it, is passed to a system_handler();
if the system_handler doesn't handle it, then it prints a notice to the
console that it couldn't handle the event.
I can send a list of the files I've finished with (and the file changes
themselves that show what I've done), as well as the files that still remain
if you like.
Tom M.
LetterRip
_________________________________________________________________
Watch LIVE baseball games on your computer with MLB.TV, included with MSN
Premium! http://join.msn.click-url.com/go/onm00200439ave/direct/01/