Re: Rolling my own ClutterInputDevice with python



hi;

On 14 August 2014 12:43, Thomas Schüßler <vindolin gmail com> wrote:
Hi,

in the current state of my program, I'm using a python object that watches
an evdev InputDevice with GLib.io_add_watch().
It's a USB remote control that emulates a keyboard/mouse.

I need to filter out some keys of the remote control and manage the repeat
rate for different keys myself.

The object converts those evdev events into Clutter key-press-events and
emits them on its focus actor.

This all works as it should but when I set the focus to the stage and try a
stage.set_key_focus() onto a ClutterText actor, no characters appear in my
actor.

Whats the correct way to implement my own InputDevice in python, so that I
can filter/handle the repeat key for the remote myself?

you cannot implement an InputDevice outside of Clutter, let alone in Python.

InputDevice instances are pure informational classes that reflect the
devices exposed by the windowing system input API.

if you have a device that appears as a keyboard then your windowing
system should expose it as a device, and Clutter can pick it up.

rummaging through the evdev file descriptor is not a great way to deal
with input.

ciao,
 Emmanuele.


-- 
http://www.bassi.io
[ ] ebassi [ gmail com]


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