XSDL: Show Ctrl/Alt/Shift keys when Android screen keyboard is shown

This commit is contained in:
Sergii Pylypenko
2015-06-05 23:28:14 +03:00
parent 81853f7ead
commit c4ae6ca2f5
5 changed files with 6 additions and 22 deletions

View File

@@ -182,7 +182,7 @@ NonBlockingSwapBuffers=n
RedefinedKeys="LALT UNDO NO_REMAP NO_REMAP UNDO HELP"
# Number of virtual keyboard keys (currently 6 is maximum)
AppTouchscreenKeyboardKeysAmount=0
AppTouchscreenKeyboardKeysAmount=3
# Redefine on-screen keyboard keys to SDL keysyms - 6 keyboard keys + 4 multitouch gestures (zoom in/out and rotate left/right)
RedefinedKeysScreenKb="LALT RETURN KP_PLUS KP_MINUS SPACE DELETE KP_PLUS KP_MINUS UNDO HELP"
@@ -196,7 +196,7 @@ RedefinedKeysScreenKbNames="LALT RETURN KP_PLUS KP_MINUS SPACE DELETE PLUS MINUS
# 2 = Sun by Sirea (yellow, with round joystick)
# 3 = Keen by Gerstrong (multicolor, with round joystick)
# 4 = Retro by Santiago Radeff (red/white, with cross joystick)
TouchscreenKeysTheme=2
TouchscreenKeysTheme=0
# Redefine gamepad keys to SDL keysyms, button order is:
# A B X Y L1 R1 L2 R2 LThumb RThumb

View File

@@ -0,0 +1 @@
../xserver-gimp/AndroidPreBuild.sh

View File

@@ -174,26 +174,8 @@ int main( int argc, char* argv[] )
if( screenButtons && !SDL_ANDROID_GetScreenKeyboardRedefinedByUser() )
{
SDL_Rect pos;
pos.x = 0;
pos.h = SDL_ListModes(NULL, 0)[0]->h / 20;
pos.y = SDL_ListModes(NULL, 0)[0]->h - pos.h;
pos.w = 40 * SDL_ListModes(NULL, 0)[0]->w / resolutionW;
// Button coords are handled inside xserver/hw/kdrive/sdl/sdl.c
SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_0, 1);
SDL_ANDROID_SetScreenKeyboardButtonPos(SDL_ANDROID_SCREENKEYBOARD_BUTTON_0, &pos);
SDL_ANDROID_SetScreenKeyboardButtonImagePos(SDL_ANDROID_SCREENKEYBOARD_BUTTON_0, &pos);
SDL_ANDROID_SetScreenKeyboardButtonStayPressedAfterTouch(SDL_ANDROID_SCREENKEYBOARD_BUTTON_0, 1);
pos.y -= pos.h;
SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_1, 1);
SDL_ANDROID_SetScreenKeyboardButtonPos(SDL_ANDROID_SCREENKEYBOARD_BUTTON_1, &pos);
SDL_ANDROID_SetScreenKeyboardButtonImagePos(SDL_ANDROID_SCREENKEYBOARD_BUTTON_1, &pos);
SDL_ANDROID_SetScreenKeyboardButtonStayPressedAfterTouch(SDL_ANDROID_SCREENKEYBOARD_BUTTON_1, 1);
pos.y -= pos.h;
SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_2, 1);
SDL_ANDROID_SetScreenKeyboardButtonPos(SDL_ANDROID_SCREENKEYBOARD_BUTTON_2, &pos);
SDL_ANDROID_SetScreenKeyboardButtonImagePos(SDL_ANDROID_SCREENKEYBOARD_BUTTON_2, &pos);
SDL_ANDROID_SetScreenKeyboardButtonStayPressedAfterTouch(SDL_ANDROID_SCREENKEYBOARD_BUTTON_2, 1);
SDL_ANDROID_SetScreenKeyboardTransparency(255); // opaque
}
__android_log_print(ANDROID_LOG_INFO, "XSDL", "XSDL video resolution %s, args:", screenres);

View File

@@ -0,0 +1 @@
../xserver-gimp/ultimatedroid.raw