Browse files

FIX: [droid] fix keyboard mappings

  • Loading branch information...
1 parent 9d5afbe commit ea424f6c8e417e7e686a4530813ac4dc057d643a @koying committed with Feb 10, 2013
Showing with 33 additions and 3 deletions.
  1. +26 −0 xbmc/android/activity/AndroidExtra.h
  2. +7 −3 xbmc/android/activity/AndroidKey.cpp
View
26 xbmc/android/activity/AndroidExtra.h
@@ -0,0 +1,26 @@
+#pragma once
+/*
+ * Copyright (C) 2013 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+ /*** Extra's not found in the Android NDK ***/
+
+ //Additional defines from android.view.KeyEvent (http://developer.android.com/reference/android/view/KeyEvent.html)
+#define AKEYCODE_ESCAPE 111
+#define AKEYCODE_FORWARD_DEL 112
View
10 xbmc/android/activity/AndroidKey.cpp
@@ -23,6 +23,8 @@
#include "guilib/Key.h"
#include "windowing/WinEvents.h"
+#include "AndroidExtra.h"
+
static KeyMap keyMap[] = {
{ AKEYCODE_UNKNOWN , XBMCK_LAST },
{ AKEYCODE_SOFT_LEFT , XBMCK_LEFT },
@@ -91,7 +93,7 @@ static KeyMap keyMap[] = {
{ AKEYCODE_EXPLORER , XBMCK_LAST },
{ AKEYCODE_ENVELOPE , XBMCK_LAST },
{ AKEYCODE_ENTER , XBMCK_RETURN },
- { AKEYCODE_DEL , XBMCK_DELETE },
+ { AKEYCODE_DEL , XBMCK_BACKSPACE },
{ AKEYCODE_GRAVE , XBMCK_BACKQUOTE },
{ AKEYCODE_MINUS , XBMCK_MINUS },
{ AKEYCODE_EQUALS , XBMCK_EQUALS },
@@ -134,7 +136,9 @@ static KeyMap keyMap[] = {
{ AKEYCODE_BUTTON_THUMBR , XBMCK_LAST },
{ AKEYCODE_BUTTON_START , XBMCK_LAST },
{ AKEYCODE_BUTTON_SELECT , XBMCK_LAST },
- { AKEYCODE_BUTTON_MODE , XBMCK_LAST }
+ { AKEYCODE_BUTTON_MODE , XBMCK_LAST },
+ { AKEYCODE_ESCAPE , XBMCK_ESCAPE },
+ { AKEYCODE_FORWARD_DEL , XBMCK_DELETE }
};
bool CAndroidKey::onKeyboardEvent(AInputEvent* event)
@@ -231,4 +235,4 @@ void CAndroidKey::XBMC_Key(uint8_t code, uint16_t key, uint16_t modifiers, bool
CXBMCApp::android_printf("XBMC_Key(%u, %u, 0x%04X, %d)", code, key, modifiers, up);
CWinEvents::MessagePush(&newEvent);
-}
+}

0 comments on commit ea424f6

Please sign in to comment.