ANDROID: adjust event handling
- controls in non-mouse mode: - use the touchpad borders as arrow keys - double tap on one of the borders triggers run mode - tap into the center area triggers the use-action (ENTER) - double-tap into the center area triggers the lookat-action ('u') - long press into the center area shows inventory in grim ('i') - a fling in the center area skips the current sentence ('.') TODO: Instead of hardcoding the keys, they should be mapped later. Note that passing events from onTouch() to the GestureListener does not seem to work correctly (most double-taps are ignored). Instead onTouchEvent() is used now which worked much better with the GestureListener.
This commit is contained in:
parent
620572e086
commit
228cc7ac64
8 changed files with 311 additions and 108 deletions
|
@ -103,7 +103,7 @@ const JNINativeMethod JNI::_natives[] = {
|
|||
(void *)JNI::setSurface },
|
||||
{ "main", "([Ljava/lang/String;)I",
|
||||
(void *)JNI::main },
|
||||
{ "pushEvent", "(IIIIII)V",
|
||||
{ "pushEvent", "(IIIIIII)V",
|
||||
(void *)JNI::pushEvent },
|
||||
{ "enableZoning", "(Z)V",
|
||||
(void *)JNI::enableZoning },
|
||||
|
@ -576,7 +576,7 @@ cleanup:
|
|||
}
|
||||
|
||||
void JNI::pushEvent(JNIEnv *env, jobject self, int type, int arg1, int arg2,
|
||||
int arg3, int arg4, int arg5) {
|
||||
int arg3, int arg4, int arg5, int arg6) {
|
||||
// drop events until we're ready and after we quit
|
||||
if (!_ready_for_events) {
|
||||
LOGW("dropping event");
|
||||
|
@ -585,7 +585,7 @@ void JNI::pushEvent(JNIEnv *env, jobject self, int type, int arg1, int arg2,
|
|||
|
||||
assert(_system);
|
||||
|
||||
_system->pushEvent(type, arg1, arg2, arg3, arg4, arg5);
|
||||
_system->pushEvent(type, arg1, arg2, arg3, arg4, arg5, arg6);
|
||||
}
|
||||
|
||||
void JNI::enableZoning(JNIEnv *env, jobject self, jboolean enable) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue