__init__(self,
view,
handler_function=None)
(Constructor)
| source code
|
creates an SL4A event handler
SL4A eventdata returned by Android.eventWait() or
Android.eventPoll().result in general take the form of a dict:
{"data":{"attribute1":value,"attribute2":value},
"name":"event_name", "time":eventtime}
The EventHandler object consists of an event_name, a compare_attribute
to look for within the "data" dict & a compare_value which
the compare_attribute will get matched against. It also has optionally an
event_handler_fn which stores a reference to the method to be called and
the reference to the view referred to by the event.
The compare_attribute can be None. if this is the case, then the
event_name alone is matched. You can use this feature to catch other SL4A
API events like sensor events
- Overrides:
object.__init__
- (inherited documentation)
|