Call for Submission
NAB 2012 Best of the Best Show Reel
Submit your work today!
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Autodesk MotionBuilder 2009 / Problems With FBEventInput
  RSS 2.0 ATOM  

Problems With FBEventInput
Rate this thread
 
35891
 
Permlink of this thread   Subscribe to this thread
avatar
  • Total Posts: 7
  • Joined: 13 June 2008 09:16 PM

I’m polishing up a user interface of mine and I would like streamline usability by adding keyboard shortcuts.  For example, I pop up a FBPopup-inherited class with an “OK” and a “Cancel” button.  I’d like to bind ESC to Cancel and Enter to OK.  Simple enough.

I add an event handler to the FBPopup class’s OnInput and write a function similar to:

void EventInput( HISender /*pSender*/HKEvent pEvent)
{
 FBEventInput inputEvent(pEvent)

 
if ( inputEvent.Key == kFBKeyEscape )
 EventButtonCancelClick(NULL
NULL)
}

Yet, I do not receive any events from the keyboard.  I only receive events when the mouse enters and exits the FBPopup class’s bounds, so the event handler is indeed functional.  Do you have to register the keyboard and mouse to properly accept events?  What am I missing here? 

I can not find anything in the documentation (or in the samples for that matter) that seems to explain why this problem may be occurring.

Any advice would be appreciated!  Thank you!



Replies: 1
/img/forum/dark/default_avatar.png

FBPopup is inherited from FBComponent class which has ViewInput() virtual function and is supposed to receive keyboard event, you can try to override this function in your own class.

/** Visual Component base class.
* All of the user interface elements available in the SDK derive from this class.
*/
class FBSDK_DLL FBVisualComponent : public FBComponent {
        
......
       
/** Input callback function.
       * \param pMouseX Mouse X position.
       * \param pMouseY Mouse Y position.
       * \param pAction Mouse action.
       * \param pButtonKey Keyboard input.
       * \param pModifier Keyboard intput modifier.
       */
       
virtual void ViewInput(int pMouseX,int pMouseY,FBInputType pAction,int pButtonKey,int pModifier)
Author: qhliao

Replied: 28 October 2009 01:57 PM  




   
  Settings Choose Theme color: