reintroduce board_handleKey

This commit is contained in:
ehouse 2007-01-18 02:42:37 +00:00
parent 5decd9bbf3
commit c01615e86b
3 changed files with 15 additions and 3 deletions

View file

@ -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

View file

@ -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,

View file

@ -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;