From 40832e6ea531a0f39378e7e39b68154c473d11ac Mon Sep 17 00:00:00 2001 From: ehouse Date: Thu, 18 Jan 2007 02:42:37 +0000 Subject: [PATCH] reintroduce board_handleKey --- common/board.c | 11 +++++++++++ common/board.h | 3 ++- wince/cemain.c | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/common/board.c b/common/board.c index ba741f396..7a92fa332 100644 --- a/common/board.c +++ b/common/board.c @@ -2736,6 +2736,17 @@ board_handleKeyUp( BoardCtxt* board, XP_Key key, XP_Bool* pHandled ) } return redraw; } /* board_handleKeyUp */ + +XP_Bool +board_handleKey( BoardCtxt* board, XP_Key key, XP_Bool* handled ) +{ + XP_Bool handled1, handled2; + XP_Bool draw = board_handleKeyDown( board, key, &handled1 ); + draw = board_handleKeyUp( board, key, &handled2 ) || draw; + *handled = handled1 || handled2; + return draw; +} + #endif #ifdef KEYBOARD_NAV diff --git a/common/board.h b/common/board.h index 9b05bf9f6..f44ca8689 100644 --- a/common/board.h +++ b/common/board.h @@ -127,9 +127,10 @@ XP_Bool board_handlePenUp( BoardCtxt* board, XP_U16 x, XP_U16 y ); #endif #ifdef KEY_SUPPORT -XP_Bool board_handleKeyUp( BoardCtxt* board, XP_Key key, XP_Bool* handled ); +XP_Bool board_handleKey( BoardCtxt* board, XP_Key key, XP_Bool* handled ); # ifdef KEYBOARD_NAV +XP_Bool board_handleKeyUp( BoardCtxt* board, XP_Key key, XP_Bool* handled ); XP_Bool board_handleKeyDown( BoardCtxt* board, XP_Key key, XP_Bool* handled ); XP_Bool board_handleKeyRepeat( BoardCtxt* board, XP_Key key, XP_Bool* handled ); XP_Bool board_focusChanged( BoardCtxt* board, BoardObjectType typ, diff --git a/wince/cemain.c b/wince/cemain.c index 6856ae24a..6b7e5af6c 100755 --- a/wince/cemain.c +++ b/wince/cemain.c @@ -2033,8 +2033,8 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) if ( wParam == 0x08 ) { wParam = XP_CURSOR_KEY_DEL; } - draw = board_handleKeyUp( globals->game.board, wParam, &handled ) - || board_handleKeyUp( globals->game.board, wParam - ('a'-'A'), + draw = board_handleKey( globals->game.board, wParam, &handled ) + || board_handleKey( globals->game.board, wParam - ('a'-'A'), &handled ); break;