RE: Gtk Event flow



Hi Varun,

Thanks for the event flow explanation. I have a another question regarding this. Do you have a similar event handling documentation at the DirectDB level? I need to understand how events are generated and handled in the DirectFB level. 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 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: river_get_keymap_entry, driver_close_device, driver_get_keymap_entry. These functions now just return the default DFB_OK return value.
  • 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]