using lirc and IO Channels for input events



I am creating a "set top box" type of application using the linux-fb
(will move to directfb once the video playing works well) gdk with
gtk+ 2.0.  All is going quite decently at this point.

I have lirc set up so I can control my application with an IR remote.
I have successfully used glib's IO Channels (g_io_channel_unix_new()
and g_io_add_watch()) to get events from lirc.  This all works fine
hooked into a single particular GtkCList (using
gtk_clist_select_row()) to have the row in the CList select with the
lirc events) in my application.

I want to make the whole concept more generic however.  Right now my
lirc event callback only works with the one GtkCList.  I will have
several widgets that I will want to control with lirc however at
different stages of the application.

I am thinking that a more generic mechanism to hook lirc events into
(say) "keyboard" events would be much more appropriate.  That way I
could simply map keys on my IR to some of the standard gtk navigation
keys (cursor keys, etc.) and then have implicit support for lirc in
all widgets automatically.

Am I going in the right direction here?  Any other suggestions would
be much appreciated.

Thanx,
b.

-- 
Brian J. Murrell

Attachment: pgpxTtd5fk6kX.pgp
Description: PGP signature



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