MISTAKE:

void* key_map[88
void* key_map_cache[88]

Should be...
void* key_map[MAX_KEY_POS];
void* key_map_cache[MAX_KEY_POS];

DON'T KNOW THAT GOT MESSED UP : (


The purpose of "void *" is the general specification for a function pointer, which the handlers are. All the def_* methods are default handlers defined in defaults.c, which is the reason for the "#ifdef default_c" (which gets defined if included). Haven't dug deep enough to know why def_video() and def_def_debug() crash when invoked in this code, as opposed to the setting them to their respective "nn_*" EVENT objects.

One odd thing is, Lite-C doesn't like locally defined function pointers, so you have to define one globally for use in functions... I hate this, but I guess this rule might relate of the "clean-up" methodology they built into the engine.

The use of a struct might be good to hold at least the key's literal name its corresponding handler's pointer. You wouldn't need to cache the key's name, so I would probably leave the caching array as is, but store the structs into the key_map[]. The key's name would only really be useful when providing an interface to see and change their key mapping, which is a good feature.

I'll keep playing and testing. I really need to learn how to effectly use debugging, which isn't as clean as I'm used to (Eclipse IDE, with JAVA).

Last edited by 3Dski; 10/25/07 00:17.