aboutsummaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-11 12:11:56 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-11 12:11:56 -0700
commitb059facee5eb498c78c573617c62cc13eddc8644 (patch)
tree0080bb1dd5afbe021917d452bcc36a99038ae334 /android
parent92c7311b1cb354745ec7b59b0e03910b3fe4c205 (diff)
downloadexternal_qemu-b059facee5eb498c78c573617c62cc13eddc8644.zip
external_qemu-b059facee5eb498c78c573617c62cc13eddc8644.tar.gz
external_qemu-b059facee5eb498c78c573617c62cc13eddc8644.tar.bz2
auto import from //branches/cupcake/...@137873
Diffstat (limited to 'android')
-rw-r--r--android/avd/hardware-properties.ini28
-rw-r--r--android/avd/hw-config-defs.h28
-rw-r--r--android/charmap.h6
-rw-r--r--android/main.c1
-rw-r--r--android/skin/keyboard.c154
-rw-r--r--android/skin/window.c6
6 files changed, 6 insertions, 217 deletions
diff --git a/android/avd/hardware-properties.ini b/android/avd/hardware-properties.ini
index f2293d1..396b364 100644
--- a/android/avd/hardware-properties.ini
+++ b/android/avd/hardware-properties.ini
@@ -65,20 +65,6 @@ default = yes
abstract = GSM modem support
description = Whether there is a GSM modem in the device.
-# Wifi support
-name = hw.wifi
-type = boolean
-default = no
-abstract = Wifi support
-description = Whether the device has a Wifi chipset.
-
-# Bluetooth support
-name = hw.bluetooth
-type = boolean
-default = no
-abstract = Bluetooth support
-description = Whether the device has a Bluetooth chipset.
-
# Camera support
name = hw.camera
type = boolean
@@ -103,13 +89,6 @@ default = no
abstract = GPS support
description = Whether there is a GPS in the device.
-# Accelerometer
-name = hw.accelerometer
-type = boolean
-default = no
-abstract = Accelerometer support
-description = Whether there is an accelerometer in the device.
-
# Battery
name = hw.battery
type = boolean
@@ -131,13 +110,6 @@ default = yes
abstract = Audio playback support
description = Whether the device can play audio
-# Compass
-name = hw.compass
-type = boolean
-default = no
-abstract = Compass support
-description = Whether there is a compass in the device.
-
# SDCard support
name = hw.sdCard
type = boolean
diff --git a/android/avd/hw-config-defs.h b/android/avd/hw-config-defs.h
index 5c3b9ab..d5ecae6 100644
--- a/android/avd/hw-config-defs.h
+++ b/android/avd/hw-config-defs.h
@@ -60,20 +60,6 @@ HWCFG_BOOL(
"Whether there is a GSM modem in the device.")
HWCFG_BOOL(
- hw_wifi,
- "hw.wifi",
- "no",
- "Wifi support",
- "Whether the device has a Wifi chipset.")
-
-HWCFG_BOOL(
- hw_bluetooth,
- "hw.bluetooth",
- "no",
- "Bluetooth support",
- "Whether the device has a Bluetooth chipset.")
-
-HWCFG_BOOL(
hw_camera,
"hw.camera",
"no",
@@ -102,13 +88,6 @@ HWCFG_BOOL(
"Whether there is a GPS in the device.")
HWCFG_BOOL(
- hw_accelerometer,
- "hw.accelerometer",
- "no",
- "Accelerometer support",
- "Whether there is an accelerometer in the device.")
-
-HWCFG_BOOL(
hw_battery,
"hw.battery",
"yes",
@@ -130,13 +109,6 @@ HWCFG_BOOL(
"Whether the device can play audio")
HWCFG_BOOL(
- hw_compass,
- "hw.compass",
- "no",
- "Compass support",
- "Whether there is a compass in the device.")
-
-HWCFG_BOOL(
hw_sdCard,
"hw.sdCard",
"yes",
diff --git a/android/charmap.h b/android/charmap.h
index f300e68..367e730 100644
--- a/android/charmap.h
+++ b/android/charmap.h
@@ -102,12 +102,6 @@ typedef enum {
kKeyCodeNotification = KEY_NOTIFICATION,
kKeyCodeSearch = KEY_SEARCH,
- kKeyCodeBtnMouse = BTN_MOUSE,
-
- kKeyCodeOrientation0 = 77,
- kKeyCodeOrientation90 = 78,
- kKeyCodeOrientation180 = 79,
- kKeyCodeOrientation270 = 80
} AndroidKeyCode;
diff --git a/android/main.c b/android/main.c
index f0029f4..de7cb66 100644
--- a/android/main.c
+++ b/android/main.c
@@ -708,6 +708,7 @@ handle_key_command( void* opaque, SkinKeyCommand command, int down )
{ SKIN_KEY_COMMAND_BUTTON_DPAD_CENTER, kKeyCodeDpadCenter },
{ SKIN_KEY_COMMAND_BUTTON_VOLUME_UP, kKeyCodeVolumeUp },
{ SKIN_KEY_COMMAND_BUTTON_VOLUME_DOWN, kKeyCodeVolumeDown },
+ { SKIN_KEY_COMMAND_BUTTON_CAMERA, kKeyCodeCamera },
{ SKIN_KEY_COMMAND_NONE, 0 }
};
int nn;
diff --git a/android/skin/keyboard.c b/android/skin/keyboard.c
index 6a9c79b..0c499df 100644
--- a/android/skin/keyboard.c
+++ b/android/skin/keyboard.c
@@ -24,8 +24,6 @@
#endif
-#define USE_KEYSET 1
-
/** LAST PRESSED KEYS
** a small buffer of last pressed keys, this is used to properly
** implement the Unicode keyboard mode (SDL key up event always have
@@ -237,7 +235,6 @@ skin_keyboard_rotate_sym( SkinKeyboard* keyboard,
return sym;
}
-#if USE_KEYSET
static AndroidKeyCode
skin_keyboard_key_to_code( SkinKeyboard* keyboard,
unsigned sym,
@@ -336,157 +333,6 @@ skin_keyboard_key_to_code( SkinKeyboard* keyboard,
skin_key_symmod_to_str(sym,mod));
return -1;
}
-#else /* !USE_KEYSET */
-/* this will look for non-Unicode key strokes, e.g. arrows, F1, F2, etc...
- * note that we have some special handling for shift-<arrow>, these will
- * be emulated as two key strokes on the device
- */
-static AndroidKeyCode
-skin_keyboard_key_to_code( SkinKeyboard* keyboard,
- unsigned sym,
- int mod,
- int down )
-{
- AndroidKeyCode code = 0;
- int doAltShift = 0;
-
- sym = skin_keyboard_rotate_sym(keyboard, sym);
-
- switch (sym) {
- case SDLK_LEFT: code = kKeyCodeDpadLeft; doAltShift = 1; break;
- case SDLK_RIGHT: code = kKeyCodeDpadRight; doAltShift = 1; break;
- case SDLK_UP: code = kKeyCodeDpadUp; doAltShift = 1; break;
- case SDLK_DOWN: code = kKeyCodeDpadDown; doAltShift = 1; break;
- case SDLK_HOME: code = kKeyCodeHome; break;
- case SDLK_BACKSPACE: code = kKeyCodeDel; doAltShift = 1; break;
- case SDLK_ESCAPE: code = kKeyCodeBack; break;
- case SDLK_RETURN: code = kKeyCodeNewline; doAltShift = 1; break;
- case SDLK_F1: code = kKeyCodeSoftLeft; break;
- case SDLK_F2: code = kKeyCodeSoftRight; break;
- case SDLK_F3: code = kKeyCodeCall; break;
- case SDLK_F4: code = kKeyCodeEndCall; break;
- case SDLK_F5: code = kKeyCodeSearch; break;
- case SDLK_F7: code = kKeyCodePower; break;
-
- case SDLK_F8: /* network connect/disconnect */
- if (down) {
- skin_keyboard_cmd( keyboard, SKIN_KEY_COMMAND_TOGGLE_NETWORK, 1 );
- }
- return 0;
-
-#ifdef CONFIG_TRACE
- case SDLK_F9: /* start tracing */
- if (down) {
- skin_keyboard_cmd( keyboard, SKIN_KEY_COMMAND_TOGGLE_TRACING, 1 );
- }
- return 0;
-
- case SDLK_F10: /* stop tracing */
- if (down) {
- skin_keyboard_cmd( keyboard, SKIN_KEY_COMMAND_TOGGLE_TRACING, 1 );
- }
- return 0;
-#endif
-
- case SDLK_F12: /* change orientation */
- if (down && (mod & (KMOD_LCTRL | KMOD_RCTRL)) != 0) {
- skin_keyboard_cmd( keyboard, SKIN_KEY_COMMAND_CHANGE_LAYOUT, +1 );
- }
- return 0;
-
- case SDLK_PAGEUP: return kKeyCodeSoftLeft;
- case SDLK_PAGEDOWN: return kKeyCodeSoftRight;
-
- case SDLK_t:
- if (down && (mod & (KMOD_LCTRL| KMOD_RCTRL)) != 0) {
- skin_keyboard_cmd( keyboard, SKIN_KEY_COMMAND_TOGGLE_TRACKBALL, 1 );
- return 0;
- }
- break;
-
- case SDLK_KP5:
- if ((mod & (KMOD_LCTRL | KMOD_RCTRL)) != 0)
- code = kKeyCodeCamera;
- break;
- }
-
- if (code != 0) {
- if (doAltShift && !keyboard->raw_keys) {
- int doCapL, doCapR, doAltL, doAltR;
-
- if (!down) {
- LastKey* k = skin_keyboard_find_last(keyboard, sym);
- if (k != NULL) {
- mod = k->mod;
- skin_keyboard_remove_last( keyboard, sym );
- }
- } else {
- skin_keyboard_add_last( keyboard, sym, mod, 0);
- }
-
- doCapL = (mod & 0x7ff) & KMOD_LSHIFT;
- doCapR = (mod & 0x7ff) & KMOD_RSHIFT;
- doAltL = (mod & 0x7ff) & KMOD_LALT;
- doAltR = (mod & 0x7ff) & KMOD_RALT;
-
- if (down) {
- if (doAltL) skin_keyboard_add_key_event( keyboard, kKeyCodeAltLeft, 1 );
- if (doAltR) skin_keyboard_add_key_event( keyboard, kKeyCodeAltRight, 1 );
- if (doCapL) skin_keyboard_add_key_event( keyboard, kKeyCodeCapLeft, 1 );
- if (doCapR) skin_keyboard_add_key_event( keyboard, kKeyCodeCapRight, 1 );
- }
- skin_keyboard_add_key_event(keyboard, code, down);
-
- if (!down) {
- if (doCapR) skin_keyboard_add_key_event( keyboard, kKeyCodeCapRight, 0 );
- if (doCapL) skin_keyboard_add_key_event( keyboard, kKeyCodeCapLeft, 0 );
- if (doAltR) skin_keyboard_add_key_event( keyboard, kKeyCodeAltRight, 0 );
- if (doAltL) skin_keyboard_add_key_event( keyboard, kKeyCodeAltLeft, 0 );
- }
- code = 0;
- }
- return code;
- }
-
- if ((mod & KMOD_NUM) == 0) {
- switch (sym) {
- case SDLK_KP8: return kKeyCodeDpadUp;
- case SDLK_KP2: return kKeyCodeDpadDown;
- case SDLK_KP4: return kKeyCodeDpadLeft;
- case SDLK_KP6: return kKeyCodeDpadRight;
- case SDLK_KP5: return kKeyCodeDpadCenter;
-
- case SDLK_KP_PLUS: return kKeyCodeVolumeUp;
- case SDLK_KP_MINUS: return kKeyCodeVolumeDown;
-
- case SDLK_KP_MULTIPLY:
- if (down) {
- skin_keyboard_cmd( keyboard, SKIN_KEY_COMMAND_ONION_ALPHA_UP, 1 );
- }
- return 0;
-
- case SDLK_KP_DIVIDE:
- if (down) {
- skin_keyboard_cmd( keyboard, SKIN_KEY_COMMAND_ONION_ALPHA_DOWN, 1 );
- }
- return 0;
-
- case SDLK_KP7:
- if (down) {
- skin_keyboard_cmd( keyboard, SKIN_KEY_COMMAND_CHANGE_LAYOUT_PREV, 1 );
- }
- return 0;
-
- case SDLK_KP9:
- if (down) {
- skin_keyboard_cmd( keyboard, SKIN_KEY_COMMAND_CHANGE_LAYOUT_NEXT, 1 );
- }
- return 0;
- }
- }
- return -1;
-}
-#endif /* !USE_KEYSET */
/* this gets called only if the reverse unicode mapping didn't work
* or wasn't used (when in raw keys mode)
diff --git a/android/skin/window.c b/android/skin/window.c
index 6612ffe..13bdca9 100644
--- a/android/skin/window.c
+++ b/android/skin/window.c
@@ -842,6 +842,10 @@ static void
add_finger_event(unsigned x, unsigned y, unsigned state)
{
//fprintf(stderr, "::: finger %d,%d %d\n", x, y, state);
+
+ /* NOTE: the 0 is used in hw/goldfish_events.c to differentiate
+ * between a touch-screen and a trackball event
+ */
kbd_mouse_event(x, y, 0, state);
}
@@ -971,7 +975,7 @@ skin_window_move_mouse( SkinWindow* window,
static void
skin_window_trackball_press( SkinWindow* window, int down )
{
- send_key_event( kKeyCodeBtnMouse, down );
+ send_key_event( BTN_MOUSE, down );
}
static void