diff --git a/xwords4/wince/cemain.c b/xwords4/wince/cemain.c index 3c409056c..43db962fa 100755 --- a/xwords4/wince/cemain.c +++ b/xwords4/wince/cemain.c @@ -2397,7 +2397,7 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) exits the app. Bad. So we'll only raise if the first was not handled. Note that this may well break on devices I haven't tested on, later, whenever. */ - && (0 == (0x1000 & LOWORD(lParam))) ) { + && (0 == (BACK_KEY_UP_MAYBE & LOWORD(lParam))) ) { XP_LOGF( "calling ceSaveAndExit for VK_TBACK" ); /* I'm actually exiting the app rather than minimize. As it stands, minimizing means that even if I relaunch diff --git a/xwords4/wince/cemain.h b/xwords4/wince/cemain.h index d3d0fe86a..4a0a3ecdd 100755 --- a/xwords4/wince/cemain.h +++ b/xwords4/wince/cemain.h @@ -190,4 +190,6 @@ XP_Bool queryBoxChar( CEAppGlobals* globals, const XP_UCHAR* msg ); (IS_SMARTPHONE(g)?LB_FINDSTRINGEXACT:CB_FINDSTRINGEXACT) #define LB_IF_PPC(g,id) (IS_SMARTPHONE(g)?id:(id+2)) + +#define BACK_KEY_UP_MAYBE 0x1000 #endif /* _CEMAIN_H_ */ diff --git a/xwords4/wince/ceutil.c b/xwords4/wince/ceutil.c index b0a52fd4a..3073520e0 100755 --- a/xwords4/wince/ceutil.c +++ b/xwords4/wince/ceutil.c @@ -407,7 +407,7 @@ ceDlgComboShowHide( CeDlgHdr* dlgHdr, XP_U16 baseId ) } static XP_Bool -editHasFocus( const CeDlgHdr* dlgHdr ) +editHasFocus( void ) { HWND focus = GetFocus(); wchar_t buf[32]; @@ -426,14 +426,14 @@ ceDoDlgHandle( CeDlgHdr* dlgHdr, UINT message, WPARAM wParam, LPARAM lParam ) #ifdef OVERRIDE_BACKKEY case WM_HOTKEY: if ( VK_TBACK == HIWORD(lParam) ) { - if ( editHasFocus( dlgHdr ) ) { + if ( editHasFocus() ) { SHSendBackToFocusWindow( message, wParam, lParam ); - handled = TRUE; - } else { + } else if ( 0 != (BACK_KEY_UP_MAYBE & LOWORD(lParam) ) ) { WPARAM cmd = (0 != (dlgHdr->doWhat & DLG_STATE_DONEONLY)) ? IDOK : IDCANCEL; SendMessage( dlgHdr->hDlg, WM_COMMAND, cmd, 0L ); } + handled = TRUE; } break; #endif