On Fri, 2010-09-17 at 10:07 +0100, [email protected] wrote: > Hi everybody, Hi,
> today I was able to compile clutter for the OMAP3530 and my simple > apps work quite ok, so many thanks for the work on that! > > Now I come to the point where I would like to add user interaction via > keyboard or mouse. The (maybe stupid) question is, if I don't have an > x-server to handle all my events, how can I receive them with clutter? If you have the usual input event drivers /dev/input/eventX, you can open the device and wait for events from there. This happens when plugging a USB keyboard or mouse or possibly a simple "2/3 keys keyboard" connected with a few GPIOs to the CPU. The best way to integrate this with Clutter's GMainLoop is to use a GIOChannel to wait and read from the file descriptor and create events from that. The structure you read from input devices, struct input_event is defined in <linux/input.h>. Now, you can make a number of refinements to the basic principle. Add a keyboard layout layer, try to look at X to reuse some stuff, add integration with udev (gudev) for the discovery of devices and hotplug, etc... keylib (http://sourceforge.net/projects/keylib/), mentioned in an other answer seems to read from the virtual terminal instead of the input devices directly and provides some integration with X (xmodmap files). It does the job but I think it would be better for clutter to have direct access to the list of devices you have on your system and handle things from there. Googling around, you can find quite a bit of resources about input devices, say http://www.linuxjournal.com/article/6429 HTH, -- Damien _______________________________________________ clutter-app-devel-list mailing list [email protected] http://lists.clutter-project.org/listinfo/clutter-app-devel-list
