From 3fb85835a10eb75c7a5b2f40504004abd94c73c3 Mon Sep 17 00:00:00 2001 From: dhewg Date: Sat, 26 Feb 2011 11:18:12 +0100 Subject: ANDROID: Allow softkeybd on all devices --- .../org/inodes/gus/scummvm/ScummVMActivity.java | 33 +++++++++------------- 1 file changed, 14 insertions(+), 19 deletions(-) (limited to 'backends/platform/android/org/inodes/gus/scummvm') diff --git a/backends/platform/android/org/inodes/gus/scummvm/ScummVMActivity.java b/backends/platform/android/org/inodes/gus/scummvm/ScummVMActivity.java index 09d39d25ea..8929809999 100644 --- a/backends/platform/android/org/inodes/gus/scummvm/ScummVMActivity.java +++ b/backends/platform/android/org/inodes/gus/scummvm/ScummVMActivity.java @@ -97,14 +97,11 @@ public class ScummVMActivity extends Activity { @Override protected void showVirtualKeyboard(final boolean enable) { - if (getResources().getConfiguration().keyboard == - Configuration.KEYBOARD_NOKEYS) { - runOnUiThread(new Runnable() { - public void run() { - showKeyboard(enable); - } - }); - } + runOnUiThread(new Runnable() { + public void run() { + showKeyboard(enable); + } + }); } } private MyScummVM scummvm; @@ -271,18 +268,16 @@ public class ScummVMActivity extends Activity { if (kevent.getRepeatCount() > 0) // Ignore keyrepeat for menu return false; - boolean timeout_fired = false; - if (getResources().getConfiguration().keyboard == - Configuration.KEYBOARD_NOKEYS) { - timeout_fired = !keycodeMenuTimeoutHandler.hasMessages(MSG_MENU_LONG_PRESS); - keycodeMenuTimeoutHandler.removeMessages(MSG_MENU_LONG_PRESS); - if (kevent.getAction() == KeyEvent.ACTION_DOWN) { - keycodeMenuTimeoutHandler.sendMessageDelayed( - keycodeMenuTimeoutHandler.obtainMessage(MSG_MENU_LONG_PRESS), - ViewConfiguration.getLongPressTimeout()); - return true; - } + + boolean timeout_fired = !keycodeMenuTimeoutHandler.hasMessages(MSG_MENU_LONG_PRESS); + keycodeMenuTimeoutHandler.removeMessages(MSG_MENU_LONG_PRESS); + + if (kevent.getAction() == KeyEvent.ACTION_DOWN) { + keycodeMenuTimeoutHandler.sendMessageDelayed(keycodeMenuTimeoutHandler.obtainMessage(MSG_MENU_LONG_PRESS), + ViewConfiguration.getLongPressTimeout()); + return true; } + if (kevent.getAction() == KeyEvent.ACTION_UP) { if (!timeout_fired) scummvm.pushEvent(new Event(Event.EVENT_MAINMENU)); -- cgit v1.2.3