On 29/12/2013 at 14:04, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13
Platform: Windows ;
Language(s) : C++ ;
---------
Hi,
I'm having a very frustrating time getting the keyboard keys to return from a MessageData plugin.
I've been able to get the key being pressed just fine in GeDialog and Tool plugins. But I can't seem to get it to work when using a MessageData plugin.
All I can get working is the qualifier keys. Like when you press the Ctrl key for example.
But no matter what I do. I can't get any of the the other keys, like the period key, to return when pressed.
Bool MyMessage::CoreMessage(LONG id, const BaseContainer &bc)
{
//This code works just fine in my GeDialog plugins when used in the Message() method
//But it doesn't work here in the CoreMessage() method in my message plugin!!??
switch(bc.GetId())
{
case BFM_INPUT:
{
if(bc.GetLong(BFM_INPUT_DEVICE) == BFM_INPUT_KEYBOARD) //If the input is from the keyboard
{
String input = bc.GetString(BFM_INPUT_ASC); //Create a string type variable...
if(input == ".")
{
GePrint("You pushed the period key"); //<---Does not print!!
}
}
break;
}
}//End the key pressed case loop /////////////////////////
///Trying to get the keys a different way
///I can only get a qualifier to work...But not the individual keys like the period key >:(
BaseContainer state;
//This qualifier code works fine
GetInputState(BFM_INPUT_KEYBOARD, BFM_INPUT_CHANNEL, state);
if(state.GetLong(BFM_INPUT_QUALIFIER) & QCTRL)
{
GePrint("You pushed the ctrl key"); //<--- Yup...prints when the Ctrl key is pressed
}
//Why doesn't this work!!??
GetInputState(BFM_INPUT_KEYBOARD, BFM_INPUT_CHANNEL, state);
if(state.GetString(BFM_INPUT_ASC) == ".")
{
GePrint("You pushed the period key"); //<--- Nope...Nothing!!?
}
return TRUE;
}
What am I doing wrong?
-ScottA