Hey thanks for the reply!
Well this is my problem:
(05-24-2013 12:37 PM)Esenthel Wrote: InputButton can operate only on KB_BUTTON - you just set the value for KB_BUTTON
How do I capture a key and set it?
I know I can set it like this:
//KB_W=0x11, // W
Byte button=KB_BUTTON::KB_W;
InputButton ForwardKey = InputButton(INPUT_KEYBOARD, button,0);
if(ForwardKey.on() ) point.y+=0.001; // when 'w', move point up
All functions in keyboard.h return Bools/chars/KB_FUNC etc.
But none return KB_BUTTON?
I'm trying to map key presses to KB_BUTTON.
Is there a way to convert the output of these:
KB_FUNC Kb.f()
char Kb.c()
To: KB_BUTTON so I can store it in InputButton.button?
Oh.. it's okay, I found it in the code here:
http://www.esenthel.com/community/showth...p?tid=4229
Wow, I see!
It involves:
*_functionKeys("0") = KB_0
etc...
AND
Map<Str,UInt> _functionKeys(a::MapFKCompare, a::MapFKCreate); // default map for command => KB conversions
And
// Map related functions
static Bool MapABCreate( Str &data, C Str &key, Ptr user) { return true; }
static Int MapABCompare(C Str &a, C Str &b) { return Compare(a, b); }
static Bool MapFKCreate( UInt &data, C Str &key, Ptr user){ return true; }
static Int MapFKCompare(C Str &a, C Str &b) { return Compare(a, b); }
Trying to figure it out, I'll get it.
Thanks again for your help.