Module fullscreenwrapper2 :: Class key_EventHandler
[hide private]
[frames] | no frames]

Class key_EventHandler

source code

  object --+    
           |    
EventHandler --+
               |
              key_EventHandler

predefined key event handler for use with Layout. defaults to Back Key with key_id = "4"

This is the event handler to typically associate with a layout. You need to pass key_id to associate with (defaults to back key = "4") & the handler function & rest of event handler initialization is handled automatically

Instance Methods [hide private]
 
__init__(self, key_match_id='4', view=None, handler_function=None)
creates an SL4A event handler
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

    Inherited from EventHandler
 
__str__(self)
convenience function for debugging
source code
 
match_event_data(self, event_data)
Provides a matching function to compare event handler vs.
source code
Class Variables [hide private]
  EVENT_NAME = 'key'
  COMPARE_ATTRIBUTE = 'key'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, key_match_id='4', view=None, 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)