XSDL: Reworked overlay Ctrl/Alt/Shift buttons
This commit is contained in:
Submodule project/jni/application/hid-pc-keyboard/src updated: 690f76feee...e90a2db4c7
@@ -192,7 +192,7 @@ AccessInternet=
|
|||||||
ImmersiveMode=y
|
ImmersiveMode=y
|
||||||
|
|
||||||
# Hide Android system mouse cursor image when USB mouse is attached (y) or (n) - the app must draw it's own mouse cursor
|
# Hide Android system mouse cursor image when USB mouse is attached (y) or (n) - the app must draw it's own mouse cursor
|
||||||
HideSystemMousePointer=
|
HideSystemMousePointer=y
|
||||||
|
|
||||||
# Application implements Android-specific routines to put to background, and will not draw anything to screen
|
# Application implements Android-specific routines to put to background, and will not draw anything to screen
|
||||||
# between SDL_ACTIVEEVENT lost / gained notifications - you should check for them
|
# between SDL_ACTIVEEVENT lost / gained notifications - you should check for them
|
||||||
|
|||||||
@@ -533,10 +533,13 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
|
|||||||
y += 30;
|
y += 30;
|
||||||
sprintf(buf, "Display number: %d", port);
|
sprintf(buf, "Display number: %d", port);
|
||||||
renderString(buf, vertical ? VID_Y / 2 : VID_X/2, y);
|
renderString(buf, vertical ? VID_Y / 2 : VID_X/2, y);
|
||||||
|
y += 30;
|
||||||
|
sprintf(buf, "Ctrl/Alt/Shift overlay: %s", *ctrlAltShiftKeys == 0 ? "No" : *ctrlAltShiftKeys == 1 ? "Yes, left side" : "Yes, right side");
|
||||||
|
renderString(buf, vertical ? VID_Y / 2 : VID_X/2, y);
|
||||||
y += 40;
|
y += 40;
|
||||||
sprintf(buf, "Starting in %d seconds", counter / 1000 + 1);
|
sprintf(buf, "Starting in %d seconds", counter / 1000 + 1);
|
||||||
renderString(buf, vertical ? VID_Y / 2 : VID_X/2, y);
|
renderString(buf, vertical ? VID_Y / 2 : VID_X/2, y);
|
||||||
SDL_Delay(100);
|
SDL_Delay(50);
|
||||||
SDL_Flip(SDL_GetVideoSurface());
|
SDL_Flip(SDL_GetVideoSurface());
|
||||||
counter -= SDL_GetTicks() - curtime;
|
counter -= SDL_GetTicks() - curtime;
|
||||||
curtime = SDL_GetTicks();
|
curtime = SDL_GetTicks();
|
||||||
@@ -599,7 +602,7 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
|
|||||||
}
|
}
|
||||||
//SDL_GetMouseState(&x, &y);
|
//SDL_GetMouseState(&x, &y);
|
||||||
//renderString("X", x, y);
|
//renderString("X", x, y);
|
||||||
SDL_Delay(100);
|
SDL_Delay(50);
|
||||||
SDL_Flip(SDL_GetVideoSurface());
|
SDL_Flip(SDL_GetVideoSurface());
|
||||||
if (res == MODE_CUSTOM)
|
if (res == MODE_CUSTOM)
|
||||||
{
|
{
|
||||||
@@ -645,7 +648,7 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
|
|||||||
renderString("Enter height:", VID_X/8, VID_Y/6);
|
renderString("Enter height:", VID_X/8, VID_Y/6);
|
||||||
renderString("Press Enter when done", VID_X*3/4, VID_Y/6);
|
renderString("Press Enter when done", VID_X*3/4, VID_Y/6);
|
||||||
renderString(custom, VID_X/8 + VID_X/4, VID_Y/6);
|
renderString(custom, VID_X/8 + VID_X/4, VID_Y/6);
|
||||||
SDL_Delay(100);
|
SDL_Delay(50);
|
||||||
SDL_Flip(SDL_GetVideoSurface());
|
SDL_Flip(SDL_GetVideoSurface());
|
||||||
}
|
}
|
||||||
__android_log_print(ANDROID_LOG_INFO, "XSDL", "Selected custom display resolution: %s = %d %d", custom, customX, customY);
|
__android_log_print(ANDROID_LOG_INFO, "XSDL", "Selected custom display resolution: %s = %d %d", custom, customX, customY);
|
||||||
@@ -719,6 +722,8 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
|
|||||||
if (event.key.keysym.sym == SDLK_HELP)
|
if (event.key.keysym.sym == SDLK_HELP)
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
|
case SDL_MOUSEBUTTONDOWN:
|
||||||
|
break;
|
||||||
case SDL_MOUSEBUTTONUP:
|
case SDL_MOUSEBUTTONUP:
|
||||||
{
|
{
|
||||||
//SDL_GetMouseState(&x, &y);
|
//SDL_GetMouseState(&x, &y);
|
||||||
@@ -729,16 +734,26 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
|
|||||||
y = z;
|
y = z;
|
||||||
}
|
}
|
||||||
if( y > 0 && y < VID_Y * 1.5f / 6 )
|
if( y > 0 && y < VID_Y * 1.5f / 6 )
|
||||||
|
{
|
||||||
*builtinKeyboard = (*builtinKeyboard + 1) % 3;
|
*builtinKeyboard = (*builtinKeyboard + 1) % 3;
|
||||||
|
}
|
||||||
if( y > VID_Y * 1.5f / 6 && y < VID_Y * 2.5f / 6 )
|
if( y > VID_Y * 1.5f / 6 && y < VID_Y * 2.5f / 6 )
|
||||||
*ctrlAltShiftKeys = !*ctrlAltShiftKeys;
|
{
|
||||||
|
*ctrlAltShiftKeys = *ctrlAltShiftKeys + 1;
|
||||||
|
if (*ctrlAltShiftKeys > 2)
|
||||||
|
{
|
||||||
|
*ctrlAltShiftKeys = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
if( y > VID_Y * 2.5f / 6 && y < VID_Y * 3.5f / 6 )
|
if( y > VID_Y * 2.5f / 6 && y < VID_Y * 3.5f / 6 )
|
||||||
{
|
{
|
||||||
port ++;
|
port ++;
|
||||||
port %= 4;
|
port %= 4;
|
||||||
}
|
}
|
||||||
if( y > VID_Y * 4 / 6 && y < VID_Y * 6 / 6 )
|
if( y > VID_Y * 4 / 6 && y < VID_Y * 6 / 6 )
|
||||||
|
{
|
||||||
okay = 1;
|
okay = 1;
|
||||||
|
}
|
||||||
__android_log_print(ANDROID_LOG_INFO, "XSDL", "Screen coords %d %d dpi %d\n", x, y, res);
|
__android_log_print(ANDROID_LOG_INFO, "XSDL", "Screen coords %d %d dpi %d\n", x, y, res);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -755,7 +770,7 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
|
|||||||
sprintf(buf, "Keyboard: %s", *builtinKeyboard == 0 ? "System" : *builtinKeyboard == 1 ? "Builtin QWERTY" : "System + Builtin");
|
sprintf(buf, "Keyboard: %s", *builtinKeyboard == 0 ? "System" : *builtinKeyboard == 1 ? "Builtin QWERTY" : "System + Builtin");
|
||||||
renderString(buf, VID_X/2, VID_Y * 1 / 6);
|
renderString(buf, VID_X/2, VID_Y * 1 / 6);
|
||||||
|
|
||||||
sprintf(buf, "Separate Ctrl/Alt/Shift keys: %s", *ctrlAltShiftKeys == 0 ? "No" : "Yes");
|
sprintf(buf, "Ctrl/Alt/Shift overlay: %s", *ctrlAltShiftKeys == 0 ? "No" : *ctrlAltShiftKeys == 1 ? "Yes, left side" : "Yes, right side");
|
||||||
renderString(buf, VID_X/2, VID_Y * 2 / 6);
|
renderString(buf, VID_X/2, VID_Y * 2 / 6);
|
||||||
|
|
||||||
sprintf(buf, "Display number: %d", port);
|
sprintf(buf, "Display number: %d", port);
|
||||||
@@ -764,7 +779,7 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
|
|||||||
sprintf(buf, "Okay");
|
sprintf(buf, "Okay");
|
||||||
renderString(buf, VID_X/2, VID_Y * 5 / 6);
|
renderString(buf, VID_X/2, VID_Y * 5 / 6);
|
||||||
|
|
||||||
SDL_Delay(100);
|
SDL_Delay(50);
|
||||||
SDL_Flip(SDL_GetVideoSurface());
|
SDL_Flip(SDL_GetVideoSurface());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -162,6 +162,8 @@ int main( int argc, char* argv[] )
|
|||||||
char s[16];
|
char s[16];
|
||||||
sprintf(s, "%d", builtinKeyboard);
|
sprintf(s, "%d", builtinKeyboard);
|
||||||
setenv("XSDL_BUILTIN_KEYBOARD", s, 1);
|
setenv("XSDL_BUILTIN_KEYBOARD", s, 1);
|
||||||
|
sprintf(s, "%d", screenButtons);
|
||||||
|
setenv("XSDL_SCREEN_BUTTONS_ALIGN", s, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
__android_log_print(ANDROID_LOG_INFO, "XSDL", "XSDL video resolution %s, args:", screenres);
|
__android_log_print(ANDROID_LOG_INFO, "XSDL", "XSDL video resolution %s, args:", screenres);
|
||||||
|
|||||||
Reference in New Issue
Block a user