--- orig/androidjniinput.cpp	2014-02-01 21:37:36.000000000 +0100
+++ androidjniinput.cpp	2014-04-14 19:00:22.656168211 +0200
@@ -290,34 +290,51 @@
         if (key >= 0x00000007 && key <= 0x00000010)
             return Qt::Key_0 + key - 0x00000007;
 
+        // NUMPAD0--NUMPAD9     0x00000090 -- 0x00000099
+        if (key >= 0x00000090 && key <= 0x00000099)
+            return Qt::Key_0 + key - 0x00000090;
+
         // A--Z        0x0000001d -- 0x00000036
         if (key >= 0x0000001d && key <= 0x00000036)
             return Qt::Key_A + key - 0x0000001d;
 
+        // F1--F12     0x00000083 (KEYCODE_F1) -- 0x0000008e (KEYCODE_F12)
+        if (key >= 0x00000083 && key <= 0x0000008e)
+            return Qt::Key_F1 + key - 0x00000083;
+
         switch (key) {
-            case 0x00000039:
-            case 0x0000003a:
+            case 0x00000039: // KEYCODE_ALT_LEFT
+            case 0x0000003a: // KEYCODE_ALT_RIGHT
                 return Qt::Key_Alt;
 
-            case 0x0000004b:
+            case 0x0000004b: // KEYCODE_APOSTROPHE
                 return Qt::Key_Apostrophe;
 
+            case 0x00000052: // KEYCODE_MENU
+                return Qt::Key_Menu;
+
             case 0x00000004: // KEYCODE_BACK
                 return Qt::Key_Back;
 
-            case 0x00000049:
+            case 0x0000007d: // KEYCODE_FORWARD
+                return Qt::Key_Forward;
+
+            case 0x0000006f: // KEYCODE_ESCAPE
+                return Qt::Key_Escape;
+
+            case 0x00000049: // KEYCODE_BACKSLASH
                 return Qt::Key_Backslash;
 
-            case 0x00000005:
+            case 0x00000005: // KEYCODE_CALL
                 return Qt::Key_Call;
 
             case 0x0000001b: // KEYCODE_CAMERA
                 return Qt::Key_Camera;
 
-            case 0x0000001c:
+            case 0x0000001c: // KEYCODE_CLEAR
                 return Qt::Key_Clear;
 
-            case 0x00000037:
+            case 0x00000037: // KEYCODE_COMMA
                 return Qt::Key_Comma;
 
             case 0x00000043: // KEYCODE_DEL
@@ -329,113 +346,86 @@
             case 0x00000014: // KEYCODE_DPAD_DOWN
                 return Qt::Key_Down;
 
-            case 0x00000015: //KEYCODE_DPAD_LEFT
+            case 0x00000015: // KEYCODE_DPAD_LEFT
                 return Qt::Key_Left;
 
-            case 0x00000016: //KEYCODE_DPAD_RIGHT
+            case 0x00000016: // KEYCODE_DPAD_RIGHT
                 return Qt::Key_Right;
 
-            case 0x00000013: //KEYCODE_DPAD_UP
+            case 0x00000013: // KEYCODE_DPAD_UP
                 return Qt::Key_Up;
 
-            case 0x00000006: //KEYCODE_ENDCALL
+            case 0x00000006: // KEYCODE_ENDCALL
                 return Qt::Key_Hangup;
 
-            case 0x00000042:
+            case 0x00000042: // KEYCODE_ENTER
                 return Qt::Key_Return;
 
-            case 0x00000041: //KEYCODE_ENVELOPE
+            case 0x00000041: // KEYCODE_ENVELOPE
                 return Qt::Key_LaunchMail;
 
-            case 0x00000046:
+            case 0x00000046: // KEYCODE_EQUALS
                 return Qt::Key_Equal;
 
-            case 0x00000040:
+            case 0x00000040: // KEYCODE_EXPLORER
                 return Qt::Key_Explorer;
 
-            case 0x00000003:
-                return Qt::Key_Home;
-
-            case 0x00000047:
+            case 0x00000047: // KEYCODE_LEFT_BRACKET
                 return Qt::Key_BracketLeft;
 
-            case 0x0000005a: // KEYCODE_MEDIA_FAST_FORWARD
-                return Qt::Key_AudioForward;
-
-            case 0x00000057:
-                return Qt::Key_MediaNext;
-
-            case 0x00000055:
-                return Qt::Key_MediaPlay;
-
-            case 0x00000058:
-                return Qt::Key_MediaPrevious;
-
-            case 0x00000059: // KEYCODE_MEDIA_REWIND
-                return Qt::Key_AudioRewind;
-
-            case 0x00000056:
-                return Qt::Key_MediaStop;
-
-            case 0x00000052: //KEYCODE_MENU
-                return Qt::Key_Menu;
-
-            case 0x00000045:
+            case 0x00000045: // KEYCODE_MINUS
                 return Qt::Key_Minus;
 
-            case 0x0000005b: // KEYCODE_MUTE
-                return Qt::Key_MicMute;
-
-            case 0x0000004e:
+            case 0x0000004e: // KEYCODE_NUM
                 return Qt::Key_NumLock;
 
-            case 0x00000038:
+            case 0x00000038: // KEYCODE_PERIOD
                 return Qt::Key_Period;
 
-            case 0x00000051:
+            case 0x00000051: // KEYCODE_PLUS
                 return Qt::Key_Plus;
 
-            case 0x0000001a:
+            case 0x0000001a: // KEYCODE_POWER
                 return Qt::Key_PowerOff;
 
-            case 0x00000048:
+            case 0x00000048: // KEYCODE_RIGHT_BRACKET
                 return Qt::Key_BracketRight;
 
-            case 0x00000054:
+            case 0x00000054: // KEYCODE_SEARCH
                 return Qt::Key_Search;
 
-            case 0x0000004a:
+            case 0x0000004a: // KEYCODE_SEMICOLON
                 return Qt::Key_Semicolon;
 
-            case 0x0000003b:
-            case 0x0000003c:
+            case 0x0000003b: // KEYCODE_SHIFT_LEFT
+            case 0x0000003c: // KEYCODE_SHIFT_RIGHT
                 return Qt::Key_Shift;
 
-            case 0x0000004c:
+            case 0x0000004c: // KEYCODE_SLASH
                 return Qt::Key_Slash;
 
-            case 0x00000001:
+            case 0x00000001: // KEYCODE_SOFT_LEFT
                 return Qt::Key_Left;
 
-            case 0x00000002:
+            case 0x00000002: // KEYCODE_SOFT_RIGHT
                 return Qt::Key_Right;
 
-            case 0x0000003e:
+            case 0x0000003e: // KEYCODE_SPACE
                 return Qt::Key_Space;
 
             case 0x0000003f: // KEYCODE_SYM
                 return Qt::Key_Meta;
 
-            case 0x0000003d:
+            case 0x0000003d: // KEYCODE_TAB
                 return Qt::Key_Tab;
 
-            case 0x00000019:
+            case 0x00000019: // KEYCODE_VOLUME_DOWN
                 return Qt::Key_VolumeDown;
 
             case 0x000000a4: // KEYCODE_VOLUME_MUTE
                 return Qt::Key_VolumeMute;
 
-            case 0x00000018:
+            case 0x00000018: // KEYCODE_VOLUME_UP
                 return Qt::Key_VolumeUp;
 
             case 0x00000011: // KEYCODE_STAR
@@ -447,9 +437,70 @@
             case 0x00000050: // KEYCODE_FOCUS
                 return Qt::Key_CameraFocus;
 
+            case 0x0000005c: // KEYCODE_PAGE_UP
+                return Qt::Key_PageUp;
+
+            case 0x0000005d: // KEYCODE_PAGE_DOWN
+                return Qt::Key_PageDown;
+
             case 0x00000070: // KEYCODE_FORWARD_DEL
                 return Qt::Key_Delete;
 
+            case 0x00000071: // KEYCODE_CTRL_LEFT
+            case 0x00000072: // KEYCODE_CTRL_RIGHT
+                return Qt::Key_Control;
+
+            case 0x00000073: // KEYCODE_CAPS_LOCK
+                return Qt::Key_CapsLock;
+
+            case 0x00000074: // KEYCODE_SCROLL_LOCK
+                return Qt::Key_ScrollLock;
+
+            case 0x00000078: // KEYCODE_SYSRQ
+                return Qt::Key_Print;
+
+            case 0x00000079: // KEYCODE_BREAK
+                return Qt::Key_Pause;
+
+            case 0x0000007a: // KEYCODE_MOVE_HOME
+                return Qt::Key_Home;
+
+            case 0x0000007b: // KEYCODE_MOVE_END
+                return Qt::Key_End;
+
+            case 0x0000007c: // KEYCODE_INSERT
+                return Qt::Key_Insert;
+
+            case 0x0000005b: // KEYCODE_MUTE
+                return Qt::Key_MicMute;
+
+            case 0x000000de: // KEYCODE_MEDIA_AUDIO_TRACK
+                return Qt::Key_AudioCycleTrack;
+
+            case 0x0000005a: // KEYCODE_MEDIA_FAST_FORWARD
+                return Qt::Key_AudioForward;
+
+            case 0x00000057: // KEYCODE_MEDIA_NEXT
+                return Qt::Key_MediaNext;
+
+            case 0x0000007e: // KEYCODE_MEDIA_PLAY
+                return Qt::Key_MediaPlay;
+
+            case 0x0000007f: // KEYCODE_MEDIA_PAUSE
+                return Qt::Key_MediaPause;
+
+            case 0x00000055: // KEYCODE_MEDIA_PLAY_PAUSE
+                return Qt::Key_MediaTogglePlayPause;
+
+            case 0x00000058: // KEYCODE_MEDIA_PREVIOUS
+                return Qt::Key_MediaPrevious;
+
+            case 0x00000059: // KEYCODE_MEDIA_REWIND
+                return Qt::Key_AudioRewind;
+
+            case 0x00000056: // KEYCODE_MEDIA_STOP
+                return Qt::Key_MediaStop;
+
             case 0x00000080: // KEYCODE_MEDIA_CLOSE
                 return Qt::Key_Close;
 
@@ -508,42 +559,41 @@
         }
     }
 
-    static void keyDown(JNIEnv */*env*/, jobject /*thiz*/, jint key, jint unicode, jint modifier)
+    static Qt::KeyboardModifiers mapAndroidModifiers(int modifier)
     {
         Qt::KeyboardModifiers modifiers;
-        if (modifier & 1)
+
+        if (modifier & 0x00000001) // META_SHIFT_ON
             modifiers |= Qt::ShiftModifier;
 
-        if (modifier & 2)
+        if (modifier & 0x00000002) // META_ALT_ON
             modifiers |= Qt::AltModifier;
 
-        if (modifier & 4)
+        if (modifier & 0x00000004) // META_SYM_ON
             modifiers |= Qt::MetaModifier;
 
+        if (modifier & 0x00001000) // META_CTRL_ON
+            modifiers |= Qt::ControlModifier;
+
+         return modifiers;
+    }
+
+    static void keyDown(JNIEnv */*env*/, jobject /*thiz*/, jint key, jint unicode, jint modifier)
+    {
         QWindowSystemInterface::handleKeyEvent(0,
                                                QEvent::KeyPress,
                                                mapAndroidKey(key),
-                                               modifiers,
+                                               mapAndroidModifiers(modifier),
                                                QChar(unicode),
                                                false);
     }
 
     static void keyUp(JNIEnv */*env*/, jobject /*thiz*/, jint key, jint unicode, jint modifier)
     {
-        Qt::KeyboardModifiers modifiers;
-        if (modifier & 1)
-            modifiers |= Qt::ShiftModifier;
-
-        if (modifier & 2)
-            modifiers |= Qt::AltModifier;
-
-        if (modifier & 4)
-            modifiers |= Qt::MetaModifier;
-
         QWindowSystemInterface::handleKeyEvent(0,
                                                QEvent::KeyRelease,
                                                mapAndroidKey(key),
-                                               modifiers,
+                                               mapAndroidModifiers(modifier),
                                                QChar(unicode),
                                                false);
     }
