Browse Source

[WP8] block back key for now.

Wei Mingzhi 9 years ago
parent
commit
92fdcdf0e4
4 changed files with 13 additions and 0 deletions
  1. 1 0
      common.h
  2. 6 0
      input.c
  3. 1 0
      main.c
  4. 5 0
      winphone/WinPhoneUtil.cpp

+ 1 - 0
common.h

@@ -126,6 +126,7 @@ extern "C"
 
 FILE *MY_fopen(const char *path, const char *mode);
 #define fopen MY_fopen
+void WinPhone_OnBackKeyPress();
 
 #else
 

+ 6 - 0
input.c

@@ -95,6 +95,12 @@ PAL_KeyboardEventFilter(
          break;
 #endif
 
+#ifdef __WINPHONE__
+	  case SDLK_AC_BACK:
+         WinPhone_OnBackKeyPress();
+         break;
+#endif
+
       case SDLK_UP:
       case SDLK_KP8:
          g_InputState.prevdir = (gpGlobals->fInBattle ? kDirUnknown : g_InputState.dir);

+ 1 - 0
main.c

@@ -530,6 +530,7 @@ main(
 
 #ifdef __WINPHONE__
    SDL_SetHint(SDL_HINT_ORIENTATIONS, "LandscapeRight");
+   SDL_SetHint(SDL_HINT_WINRT_HANDLE_BACK_BUTTON, "1");
 #endif
 
    UTIL_OpenLog();

+ 5 - 0
winphone/WinPhoneUtil.cpp

@@ -42,3 +42,8 @@ MY_fopen(const char *path, const char *mode)
 	}
 	return fp;
 }
+
+extern "C" void
+WinPhone_OnBackKeyPress()
+{
+}