Hello,
I have a beginner level question related to the MMSInputManager.
My goal is to be able to catch user inputs from keyboard and take the appropriate action. For example, let's say I want to print a message on the shell each time the user presses the ESCAPE key.
Here is what I am trying to do, but when I run the application I get a segmentation fault:
Code: |
#include <mms.h>
int main(int argc, char *argv[])
{
MMSInputManager im("./inputmap.xml", "mymanager");
im.addDevice(MMS_INPUT_KEYBOARD, 1);
MMSInputSubscription insub(MMSKEY_ESCAPE);
insub.registerMe();
im.addSubscription(&insub);
im.startListen();
pause();
return 0;
}
|
Should I always use mmsInit()? If so, how can I then access the user inputs?
As you may see, I am still trying to understand how some of the pieces stick together within the disko framework. Therefore, I would really appreciate some help here, since I honestly could not get the picture from the API reference page.
Thanks in advance.
Regards,
André