Hi,
I am adding another device to capture events. As part of this, I am
trying to hook up GUI events(like up/down/arrow keys) coming from my
device to GTK. I cannot use the existing input handlers. So far what I
am doing is the following:
* In inputdrivers/keyboard.c file, function driver_open_device, I
register my custom callback functions with my device driver user level
interface module. I remove everything else in the function. Similarly, I
remove the default implementation is functions: driver_get_keymap_entry,
driver_close_device, driver_get_keymap_entry. These functions now just
return the default DFB_OK return value. I understand this is probably a
hack, but this was the fastest way to use existing code without
modifying any makefiles or config files.
* In my custom handler, I fill a DFBInputEvent local variable,
evt, with(in this example, the event I want to send to GTK is the down
keypress):
evt.key_id = DIKI_DOWN; evt.type = DIET_KEYRELEASE; evt.flags =
DIEF_KEYCODE | DIEF_KEYID; evt.key_code = DIKS_CURSOR_DOWN;
* Now, I call dfb_input_dispatch( inpdevice, &evt );, where
inpdevice is the CoreInputDevice ptr passed to driver_open_device.
* The function dfb_input_dispatch is called and completes without
issues.
* I do not see any change to the UI. For some reason, the event is
not processed. I expect the UI to change to reflect that down key was
pressed.
Is there anything different that I need to do in this flow? What I want
to do is to simply catch the event coming from my device and pass is to
GTK for processing. This is my current approach. I am using GTK2.10.12
and DirectFB-1.0.0 on linux.
Any help would be appreciated.
Thanks
- Narayanan
_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev