From d4014f5f7f73f3b3774c498ee5a0145752f9a25b Mon Sep 17 00:00:00 2001 From: Daniel Nagel Date: Mon, 1 Sep 2014 15:46:14 +0200 Subject: [PATCH 1/8] Update to SDL2 --- base/NKCodeFromSDL.h | 20 +++--- base/PCMain.cpp | 151 +++++++++++++++++++------------------------ 2 files changed, 76 insertions(+), 95 deletions(-) diff --git a/base/NKCodeFromSDL.h b/base/NKCodeFromSDL.h index 6c5f599832..62cb8cd6dd 100644 --- a/base/NKCodeFromSDL.h +++ b/base/NKCodeFromSDL.h @@ -65,16 +65,16 @@ static const std::map KeyMapRawSDLtoNative = InitConstMap (SDLK_HOME, NKCODE_MOVE_HOME) (SDLK_END, NKCODE_MOVE_END) (SDLK_INSERT, NKCODE_INSERT) - (SDLK_KP0, NKCODE_NUMPAD_0) - (SDLK_KP1, NKCODE_NUMPAD_1) - (SDLK_KP2, NKCODE_NUMPAD_2) - (SDLK_KP3, NKCODE_NUMPAD_3) - (SDLK_KP4, NKCODE_NUMPAD_4) - (SDLK_KP5, NKCODE_NUMPAD_5) - (SDLK_KP6, NKCODE_NUMPAD_6) - (SDLK_KP7, NKCODE_NUMPAD_7) - (SDLK_KP8, NKCODE_NUMPAD_8) - (SDLK_KP9, NKCODE_NUMPAD_9) + (SDLK_KP_0, NKCODE_NUMPAD_0) + (SDLK_KP_1, NKCODE_NUMPAD_1) + (SDLK_KP_2, NKCODE_NUMPAD_2) + (SDLK_KP_3, NKCODE_NUMPAD_3) + (SDLK_KP_4, NKCODE_NUMPAD_4) + (SDLK_KP_5, NKCODE_NUMPAD_5) + (SDLK_KP_6, NKCODE_NUMPAD_6) + (SDLK_KP_7, NKCODE_NUMPAD_7) + (SDLK_KP_8, NKCODE_NUMPAD_8) + (SDLK_KP_9, NKCODE_NUMPAD_9) (SDLK_KP_DIVIDE, NKCODE_NUMPAD_DIVIDE) (SDLK_KP_MULTIPLY, NKCODE_NUMPAD_MULTIPLY) (SDLK_KP_MINUS, NKCODE_NUMPAD_SUBTRACT) diff --git a/base/PCMain.cpp b/base/PCMain.cpp index cda16b7877..051df396b2 100644 --- a/base/PCMain.cpp +++ b/base/PCMain.cpp @@ -15,9 +15,6 @@ #endif #include "SDL.h" -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "SDL_video.h" #ifndef _WIN32 #include "SDL/SDLJoystick.h" SDLJoystick *joystick = NULL; @@ -50,7 +47,7 @@ GlobalUIState lastUIState = UISTATE_MENU; GlobalUIState GetUIState(); #endif -static SDL_Surface* g_Screen = NULL; +static SDL_Window* g_Screen = NULL; static bool g_ToggleFullScreenNextFrame = false; static int g_QuitRequested = 0; @@ -357,14 +354,8 @@ void ToggleFullScreenIfFlagSet() { dp_xres = (float)pixel_xres; dp_yres = (float)pixel_yres; - int flags = g_Screen->flags; // Save the current flags in case toggling fails - g_Screen = SDL_SetVideoMode(g_DesktopWidth, g_DesktopHeight, 0, g_Screen->flags ^ SDL_FULLSCREEN); // Toggles FullScreen Mode - if (g_Screen == NULL) { - g_Screen = SDL_SetVideoMode(0, 0, 0, flags); // If toggle FullScreen failed, then switch back - } - if (g_Screen == NULL) { - exit(1); // If you can't switch back for some reason, then epic fail - } + Uint32 window_flags = SDL_GetWindowFlags(g_Screen); + SDL_SetWindowFullscreen(g_Screen, window_flags ^ SDL_WINDOW_FULLSCREEN_DESKTOP); NativeResized(); #endif @@ -386,28 +377,37 @@ int main(int argc, char *argv[]) { NativeGetAppInfo(&app_name, &app_name_nice, &landscape); net::Init(); -#ifdef __APPLE__ - // Make sure to request a somewhat modern GL context at least - the - // latest supported by MacOSX (really, really sad...) - // Requires SDL 2.0 - // We really should upgrade to SDL 2.0 soon. - //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); - //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); -#endif if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO) < 0) { fprintf(stderr, "Unable to initialize SDL: %s\n", SDL_GetError()); return 1; } + +#ifdef __APPLE__ + // Make sure to request a somewhat modern GL context at least - the + // latest supported by MacOSX (really, really sad...) + // Requires SDL 2.0 + // We really should upgrade to SDL 2.0 soon. + //SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); + //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); + //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); +#endif + #ifdef USING_EGL if (EGL_Open()) return 1; #endif // Get the video info before doing anything else, so we don't get skewed resolution results. - const SDL_VideoInfo* desktopVideoInfo = SDL_GetVideoInfo(); - g_DesktopWidth = desktopVideoInfo->current_w; - g_DesktopHeight = desktopVideoInfo->current_h; + // TODO: support multiple displays correctly + SDL_DisplayMode displayMode; + int should_be_zero = SDL_GetCurrentDisplayMode(0, &displayMode); + if (should_be_zero != 0) { + fprintf(stderr, "Could not get display mode: %s\n", SDL_GetError()); + return 1; + } + g_DesktopWidth = displayMode.w; + g_DesktopHeight = displayMode.h; SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8); @@ -415,13 +415,13 @@ int main(int argc, char *argv[]) { SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); - SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1); + SDL_GL_SetSwapInterval(1); - int mode; + Uint32 mode; #ifdef USING_GLES2 mode = SDL_SWSURFACE | SDL_FULLSCREEN; #else - mode = SDL_OPENGL | SDL_RESIZABLE; + mode = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE; #endif int set_xres = -1; int set_yres = -1; @@ -432,7 +432,7 @@ int main(int argc, char *argv[]) { for (int i = 1; i < argc; i++) { if (!strcmp(argv[i],"--fullscreen")) - mode |= SDL_FULLSCREEN; + mode |= SDL_WINDOW_FULLSCREEN_DESKTOP; if (set_xres == -2) { set_xres = parseInt(argv[i]); } else if (set_yres == -2) { @@ -458,10 +458,9 @@ int main(int argc, char *argv[]) { portrait = true; } - if (mode & SDL_FULLSCREEN) { - const SDL_VideoInfo* info = SDL_GetVideoInfo(); - pixel_xres = info->current_w; - pixel_yres = info->current_h; + if (mode & SDL_WINDOW_FULLSCREEN_DESKTOP) { + pixel_xres = g_DesktopWidth; + pixel_yres = g_DesktopHeight; #ifdef PPSSPP g_Config.bFullScreen = true; #endif @@ -501,19 +500,21 @@ int main(int argc, char *argv[]) { dp_xres = (float)pixel_xres * dpi_scale; dp_yres = (float)pixel_yres * dpi_scale; - g_Screen = SDL_SetVideoMode(pixel_xres, pixel_yres, 0, mode); + g_Screen = SDL_CreateWindow(app_name_nice.c_str(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, pixel_xres, pixel_yres, 0); if (g_Screen == NULL) { fprintf(stderr, "SDL SetVideoMode failed: Unable to create OpenGL screen: %s\n", SDL_GetError()); SDL_Quit(); return 2; } + SDL_GLContext glContext = SDL_GL_CreateContext(g_Screen); + #ifdef USING_EGL EGL_Init(); #endif #ifdef PPSSPP - SDL_WM_SetCaption((app_name_nice + " " + PPSSPP_GIT_VERSION).c_str(), NULL); + SDL_SetWindowTitle(g_Screen, (app_name_nice + " " + PPSSPP_GIT_VERSION).c_str()); #endif #ifdef MOBILE_DEVICE @@ -618,21 +619,19 @@ int main(int argc, char *argv[]) { g_QuitRequested = 1; break; #if !defined(MOBILE_DEVICE) - case SDL_VIDEORESIZE: - { - g_Screen = SDL_SetVideoMode(event.resize.w, event.resize.h, 0, SDL_OPENGL | SDL_RESIZABLE); - if (g_Screen == NULL) { - fprintf(stderr, "SDL SetVideoMode failed: Unable to create OpenGL screen: %s\n", SDL_GetError()); - SDL_Quit(); - return 2; + case SDL_WINDOWEVENT: + switch (event.window.event) { + case SDL_WINDOWEVENT_RESIZED: + { + pixel_xres = event.window.data1; + pixel_yres = event.window.data2; + dp_xres = (float)pixel_xres * dpi_scale; + dp_yres = (float)pixel_yres * dpi_scale; + NativeResized(); + break; + } + break; } - pixel_xres = event.resize.w; - pixel_yres = event.resize.h; - dp_xres = (float)pixel_xres * dpi_scale; - dp_yres = (float)pixel_yres * dpi_scale; - NativeResized(); - break; - } #endif case SDL_KEYDOWN: { @@ -687,26 +686,25 @@ int main(int argc, char *argv[]) { NativeKey(key); } break; - case SDL_BUTTON_WHEELUP: - { - KeyInput key; - key.deviceId = DEVICE_ID_MOUSE; - key.keyCode = NKCODE_EXT_MOUSEWHEEL_UP; - key.flags = KEY_DOWN; - NativeKey(key); - } - break; - case SDL_BUTTON_WHEELDOWN: - { - KeyInput key; - key.deviceId = DEVICE_ID_MOUSE; - key.keyCode = NKCODE_EXT_MOUSEWHEEL_DOWN; - key.flags = KEY_DOWN; - NativeKey(key); - } - break; } break; + case SDL_MOUSEWHEEL: + { + KeyInput key; + key.deviceId = DEVICE_ID_MOUSE; + if (event.wheel.y > 0) { + key.keyCode = NKCODE_EXT_MOUSEWHEEL_UP; + } else { + key.keyCode = NKCODE_EXT_MOUSEWHEEL_DOWN; + } + key.flags = KEY_DOWN; + NativeKey(key); + + // SDL2 doesn't consider the mousewheel a button anymore + // so let's send the KEY_UP right away + key.flags = KEY_UP; + NativeKey(key); + } case SDL_MOUSEMOTION: if (input_state.pointer_down[0]) { input_state.pointer_x[0] = mx; @@ -745,24 +743,6 @@ int main(int argc, char *argv[]) { NativeKey(key); } break; - case SDL_BUTTON_WHEELUP: - { - KeyInput key; - key.deviceId = DEVICE_ID_MOUSE; - key.keyCode = NKCODE_EXT_MOUSEWHEEL_UP; - key.flags = KEY_UP; - NativeKey(key); - } - break; - case SDL_BUTTON_WHEELDOWN: - { - KeyInput key; - key.deviceId = DEVICE_ID_MOUSE; - key.keyCode = NKCODE_EXT_MOUSEWHEEL_DOWN; - key.flags = KEY_UP; - NativeKey(key); - } - break; } break; default: @@ -774,7 +754,7 @@ int main(int argc, char *argv[]) { } if (g_QuitRequested) break; - const uint8 *keys = (const uint8 *)SDL_GetKeyState(NULL); + const uint8 *keys = SDL_GetKeyboardState(NULL); SimulateGamepad(keys, &input_state); input_state.pad_buttons = pad_buttons; UpdateInputState(&input_state, true); @@ -805,7 +785,7 @@ int main(int argc, char *argv[]) { #else if (!keys[SDLK_TAB] || t - lastT >= 1.0/60.0) { - SDL_GL_SwapBuffers(); + SDL_GL_SwapWindow(g_Screen); lastT = t; } #endif @@ -830,6 +810,7 @@ int main(int argc, char *argv[]) { #ifdef USING_EGL EGL_Close(); #endif + SDL_GL_DeleteContext(glContext); SDL_Quit(); net::Shutdown(); #ifdef RPI From 66c19727ce59e77de724ecf68569f8fe9170fa83 Mon Sep 17 00:00:00 2001 From: Daniel Nagel Date: Mon, 1 Sep 2014 20:24:26 +0200 Subject: [PATCH 2/8] Add missing mode flag --- base/PCMain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/PCMain.cpp b/base/PCMain.cpp index 051df396b2..c1f80dd0e9 100644 --- a/base/PCMain.cpp +++ b/base/PCMain.cpp @@ -500,7 +500,7 @@ int main(int argc, char *argv[]) { dp_xres = (float)pixel_xres * dpi_scale; dp_yres = (float)pixel_yres * dpi_scale; - g_Screen = SDL_CreateWindow(app_name_nice.c_str(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, pixel_xres, pixel_yres, 0); + g_Screen = SDL_CreateWindow(app_name_nice.c_str(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, pixel_xres, pixel_yres, mode); if (g_Screen == NULL) { fprintf(stderr, "SDL SetVideoMode failed: Unable to create OpenGL screen: %s\n", SDL_GetError()); SDL_Quit(); From 439ea67cc2f84267bfcb932a0c2efd818ce239ca Mon Sep 17 00:00:00 2001 From: Daniel Nagel Date: Tue, 2 Sep 2014 07:34:08 +0200 Subject: [PATCH 3/8] Add error handling for SDL_GL_CreateContext --- base/PCMain.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/base/PCMain.cpp b/base/PCMain.cpp index c1f80dd0e9..6afa48eb64 100644 --- a/base/PCMain.cpp +++ b/base/PCMain.cpp @@ -502,12 +502,17 @@ int main(int argc, char *argv[]) { g_Screen = SDL_CreateWindow(app_name_nice.c_str(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, pixel_xres, pixel_yres, mode); if (g_Screen == NULL) { - fprintf(stderr, "SDL SetVideoMode failed: Unable to create OpenGL screen: %s\n", SDL_GetError()); + fprintf(stderr, "SDL_CreateWindow failed: %s\n", SDL_GetError()); SDL_Quit(); return 2; } SDL_GLContext glContext = SDL_GL_CreateContext(g_Screen); + if (glContext == NULL) { + fprintf(stderr, "SDL_GL_CreateContext failed: %s\n", SDL_GetError()); + SDL_Quit(); + return 2; + } #ifdef USING_EGL EGL_Init(); From 4a85cbe4040e4a33484e8b895a4d84ed1e66479d Mon Sep 17 00:00:00 2001 From: Daniel Nagel Date: Thu, 4 Sep 2014 10:20:04 +0200 Subject: [PATCH 4/8] Make sure fullscreen state is properly reflected in the UI --- base/PCMain.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/base/PCMain.cpp b/base/PCMain.cpp index 6afa48eb64..5285640407 100644 --- a/base/PCMain.cpp +++ b/base/PCMain.cpp @@ -348,17 +348,8 @@ void ToggleFullScreenIfFlagSet() { if (g_ToggleFullScreenNextFrame) { g_ToggleFullScreenNextFrame = false; -#if 1 - pixel_xres = g_DesktopWidth; - pixel_yres = g_DesktopHeight; - dp_xres = (float)pixel_xres; - dp_yres = (float)pixel_yres; - Uint32 window_flags = SDL_GetWindowFlags(g_Screen); SDL_SetWindowFullscreen(g_Screen, window_flags ^ SDL_WINDOW_FULLSCREEN_DESKTOP); - - NativeResized(); -#endif } } @@ -628,11 +619,26 @@ int main(int argc, char *argv[]) { switch (event.window.event) { case SDL_WINDOWEVENT_RESIZED: { + Uint32 window_flags = SDL_GetWindowFlags(g_Screen); + bool fullscreen = (window_flags & SDL_WINDOW_FULLSCREEN); + pixel_xres = event.window.data1; pixel_yres = event.window.data2; dp_xres = (float)pixel_xres * dpi_scale; dp_yres = (float)pixel_yres * dpi_scale; NativeResized(); + +#if defined(PPSSPP) + // Set variable here in case fullscreen was toggled by hotkey + g_Config.bFullScreen = fullscreen; + + // Hide/Show cursor correctly toggling fullscreen + if (lastUIState == UISTATE_INGAME && fullscreen && !g_Config.bShowTouchControls) { + SDL_ShowCursor(SDL_DISABLE); + } else if (lastUIState != UISTATE_INGAME || !fullscreen) { + SDL_ShowCursor(SDL_ENABLE); + } +#endif break; } break; @@ -706,7 +712,8 @@ int main(int argc, char *argv[]) { NativeKey(key); // SDL2 doesn't consider the mousewheel a button anymore - // so let's send the KEY_UP right away + // so let's send the KEY_UP right away. + // Maybe KEY_UP alone will suffice? key.flags = KEY_UP; NativeKey(key); } From 167f2a8a2c106bc38201c70ed74cf73dba94517f Mon Sep 17 00:00:00 2001 From: The Dax Date: Sun, 14 Sep 2014 19:51:13 -0400 Subject: [PATCH 5/8] Add functionality to the MessagePopupScreen class. It can more or less replace PromptScreen in PPSSPP. --- ui/ui_screen.cpp | 15 ++++++++++++++- ui/ui_screen.h | 8 +++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ui/ui_screen.cpp b/ui/ui_screen.cpp index 66f6eec6bc..c13ebf5733 100644 --- a/ui/ui_screen.cpp +++ b/ui/ui_screen.cpp @@ -206,7 +206,20 @@ void PopupScreen::CreateViews() { } void MessagePopupScreen::CreatePopupContents(UI::ViewGroup *parent) { - parent->Add(new UI::TextView(message_)); + std::vector messageLines; + SplitString(message_, '\n', messageLines); + for (const auto& lineOfText : messageLines) + parent->Add(new UI::TextView(lineOfText, ALIGN_LEFT | ALIGN_VCENTER, false)); +} + +void MessagePopupScreen::OnCompleted(DialogResult result) { + if (result == DR_OK) { + if (callback_) + callback_(true); + } else { + if (callback_) + callback_(false); + } } UI::EventReturn PopupScreen::OnOK(UI::EventParams &e) { diff --git a/ui/ui_screen.h b/ui/ui_screen.h index 85cc5f7863..42362ba08a 100644 --- a/ui/ui_screen.h +++ b/ui/ui_screen.h @@ -110,8 +110,9 @@ private: class MessagePopupScreen : public PopupScreen { public: - MessagePopupScreen(std::string title, std::string message, std::string button1, std::string button2, std::function callback) : PopupScreen(title) {} - UI::Event OnChoice; + MessagePopupScreen(std::string title, std::string message, std::string button1, std::string button2, std::function callback) + : PopupScreen(title, button1, button2), message_(message), callback_(callback) {} + UI::Event OnChange; protected: virtual bool FillVertical() const override { return false; } @@ -119,8 +120,9 @@ protected: virtual void CreatePopupContents(UI::ViewGroup *parent) override; private: + void OnCompleted(DialogResult result) override; std::string message_; - std::function callback_; + std::function callback_; }; // TODO: Need a way to translate OK and Cancel From 03ed11fa0fc8d893b10cf370d1d7ac71ca75d3bc Mon Sep 17 00:00:00 2001 From: The Dax Date: Tue, 16 Sep 2014 03:57:39 -0400 Subject: [PATCH 6/8] Change OnChange back to OnChoice. Not like it's used anyway, but it doesn't hurt. --- ui/ui_screen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/ui_screen.h b/ui/ui_screen.h index 42362ba08a..edabf4d262 100644 --- a/ui/ui_screen.h +++ b/ui/ui_screen.h @@ -112,7 +112,7 @@ class MessagePopupScreen : public PopupScreen { public: MessagePopupScreen(std::string title, std::string message, std::string button1, std::string button2, std::function callback) : PopupScreen(title, button1, button2), message_(message), callback_(callback) {} - UI::Event OnChange; + UI::Event OnChoice; protected: virtual bool FillVertical() const override { return false; } From c5bb2c7b23e9fbfdb53650768042b90fec689fa8 Mon Sep 17 00:00:00 2001 From: Franklin S Cooper Jr Date: Fri, 26 Sep 2014 18:47:19 -0500 Subject: [PATCH 7/8] base: Allow building when not using X11 on a FBDEV based system * Currently building base will fail on non X11 based systems due to inclusion of X11 headers and some calls to X11 functions. * Portions of the code currently attempts to avoid calling X11 functions when fbdev is used. This patch adds additional checks to avoid X11 calls. Signed-off-by: Franklin S Cooper Jr --- base/PCMain.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/base/PCMain.cpp b/base/PCMain.cpp index 13983b8070..81e939cbae 100644 --- a/base/PCMain.cpp +++ b/base/PCMain.cpp @@ -59,16 +59,24 @@ static int g_DesktopHeight = 0; #if defined(USING_EGL) #include "EGL/egl.h" + +#if !defined(USING_FBDEV) #include #include +#endif + #include "SDL_syswm.h" #include "math.h" -static EGLDisplay g_eglDisplay = NULL; -static EGLContext g_eglContext = NULL; -static EGLSurface g_eglSurface = NULL; -static Display* g_Display = NULL; -static NativeWindowType g_Window = (NativeWindowType)NULL; +static EGLDisplay g_eglDisplay = NULL; +static EGLContext g_eglContext = NULL; +static EGLSurface g_eglSurface = NULL; +#ifdef USING_FBDEV +static EGLNativeDisplayType g_Display = NULL; +#else +static Display* g_Display = NULL; +#endif +static NativeWindowType g_Window = (NativeWindowType)NULL; int8_t CheckEGLErrors(const std::string& file, uint16_t line) { EGLenum error; @@ -144,13 +152,15 @@ int8_t EGL_Init() { g_eglContext = eglCreateContext(g_eglDisplay, g_eglConfig, NULL, attributes ); if (g_eglContext == EGL_NO_CONTEXT) EGL_ERROR("Unable to create GLES context!", true); - // Get the SDL window handle +#if !defined(USING_FBDEV) + //Get the SDL window handle SDL_SysWMinfo sysInfo; //Will hold our Window information SDL_VERSION(&sysInfo.version); //Set SDL version if (SDL_GetWMInfo(&sysInfo) <= 0) { printf("EGL ERROR: Unable to get SDL window handle: %s\n", SDL_GetError()); return 1; } +#endif #ifdef USING_FBDEV g_Window = (NativeWindowType)NULL; @@ -180,7 +190,9 @@ void EGL_Close() { g_eglDisplay = NULL; } if (g_Display != NULL) { +#if !defined(USING_FBDEV) XCloseDisplay(g_Display); +#endif g_Display = NULL; } g_eglSurface = NULL; From d3743d0f39554d68f1bb585e2b51892e2adbbdba Mon Sep 17 00:00:00 2001 From: Sacha Date: Thu, 9 Oct 2014 04:58:47 +1000 Subject: [PATCH 8/8] Fix pause menu on Blackberry. --- base/BlackberryMain.cpp | 2 +- base/NKCodeFromBlackberry.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/base/BlackberryMain.cpp b/base/BlackberryMain.cpp index 338639baa6..0ce861247b 100644 --- a/base/BlackberryMain.cpp +++ b/base/BlackberryMain.cpp @@ -279,7 +279,7 @@ void BlackberryMain::runMain() { break; case NAVIGATOR_BACK: case NAVIGATOR_SWIPE_DOWN: - NativeKey(KeyInput(DEVICE_ID_KEYBOARD, NKCODE_ESCAPE, KEY_DOWN)); + NativeKey(KeyInput(DEVICE_ID_KEYBOARD, NKCODE_BACK, KEY_DOWN)); break; case NAVIGATOR_EXIT: return; diff --git a/base/NKCodeFromBlackberry.h b/base/NKCodeFromBlackberry.h index 2b73c6a8d4..d32f39bd9e 100644 --- a/base/NKCodeFromBlackberry.h +++ b/base/NKCodeFromBlackberry.h @@ -11,7 +11,7 @@ static const std::map KeyMapPadBlackberrytoNative = InitConstMap