Google search is your friend, and so are the docs.
http://developer.android.com/intl/de/reference/android/app/Activity.html#onKeyDown%28int,%20android.view.KeyEvent%29
Didn't test it but something like this
@Override
public boolean onKeyDown(int key, KeyEvent ev) {
switch(key) {
case KeyEvent.KEYCODE_A:
//do some stuff
break;
default:
return false;
}
return super.onKeyDown(key, ev);
}
On Feb 15, 2:19 pm, BobG <[email protected]> wrote:
> I asked this question on Android Beginners several days ago, but didnt
> get any nibbles. I have an app that almost works... I can draw the
> needle on my gauge rotated, but I want to use A and Z keys to
> increment and decrement the needle angle. I'd be gratefule if someone
> could shoe me an example that catches the A key with onKeyDown,
> increments a variable, and prints it out (drawText?). Thanks in
> advance, fellow developers. I hope to be one soon.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en