I need to add onKeyUp()
/onKeyDown()
event handling to my application, in which I did not create the Activity
and main View
. (Getting OuyaController
working with a Marmalade SDK application).
With onGenericMotion()
it seems straightforward (view.setOnGenericMotionListener()
), however I'm confused about view.setOnKeyListener()
, as the interface of the android.View.OnKeyListener
that it takes as an argument has a single onKey()
method, and not onKeyUp()
/onKeyDown()
.
Apparently, view.KeyEvent.Callback
has this interface, which Activity
and View
implement - what class has this interface and how can I add its functionality to a View
procedurally?