mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
set focus to board if not held prior to passing keys
This commit is contained in:
parent
6c93fc0a0c
commit
594c48fce6
1 changed files with 14 additions and 0 deletions
|
@ -348,9 +348,19 @@ handleQuit( CursesAppGlobals* globals )
|
||||||
return XP_TRUE;
|
return XP_TRUE;
|
||||||
} /* handleQuit */
|
} /* handleQuit */
|
||||||
|
|
||||||
|
static void
|
||||||
|
checkAssignFocus( BoardCtxt* board )
|
||||||
|
{
|
||||||
|
if ( OBJ_NONE == board_getFocusOwner(board) ) {
|
||||||
|
board_focusChanged( board, OBJ_BOARD, XP_TRUE );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static XP_Bool
|
static XP_Bool
|
||||||
handleTab( CursesAppGlobals* globals )
|
handleTab( CursesAppGlobals* globals )
|
||||||
{
|
{
|
||||||
|
checkAssignFocus( globals->cGlobals.game.board );
|
||||||
|
|
||||||
globals->doDraw = board_handleKey( globals->cGlobals.game.board,
|
globals->doDraw = board_handleKey( globals->cGlobals.game.board,
|
||||||
XP_FOCUSCHANGE_KEY );
|
XP_FOCUSCHANGE_KEY );
|
||||||
return XP_TRUE;
|
return XP_TRUE;
|
||||||
|
@ -469,6 +479,7 @@ MenuList sharedMenuList[] = {
|
||||||
static XP_Bool
|
static XP_Bool
|
||||||
handleLeft( CursesAppGlobals* globals )
|
handleLeft( CursesAppGlobals* globals )
|
||||||
{
|
{
|
||||||
|
checkAssignFocus( globals->cGlobals.game.board );
|
||||||
globals->doDraw = board_handleKey( globals->cGlobals.game.board,
|
globals->doDraw = board_handleKey( globals->cGlobals.game.board,
|
||||||
XP_CURSOR_KEY_LEFT );
|
XP_CURSOR_KEY_LEFT );
|
||||||
return XP_TRUE;
|
return XP_TRUE;
|
||||||
|
@ -477,6 +488,7 @@ handleLeft( CursesAppGlobals* globals )
|
||||||
static XP_Bool
|
static XP_Bool
|
||||||
handleRight( CursesAppGlobals* globals )
|
handleRight( CursesAppGlobals* globals )
|
||||||
{
|
{
|
||||||
|
checkAssignFocus( globals->cGlobals.game.board );
|
||||||
globals->doDraw = board_handleKey( globals->cGlobals.game.board,
|
globals->doDraw = board_handleKey( globals->cGlobals.game.board,
|
||||||
XP_CURSOR_KEY_RIGHT );
|
XP_CURSOR_KEY_RIGHT );
|
||||||
return XP_TRUE;
|
return XP_TRUE;
|
||||||
|
@ -485,6 +497,7 @@ handleRight( CursesAppGlobals* globals )
|
||||||
static XP_Bool
|
static XP_Bool
|
||||||
handleUp( CursesAppGlobals* globals )
|
handleUp( CursesAppGlobals* globals )
|
||||||
{
|
{
|
||||||
|
checkAssignFocus( globals->cGlobals.game.board );
|
||||||
globals->doDraw = board_handleKey( globals->cGlobals.game.board,
|
globals->doDraw = board_handleKey( globals->cGlobals.game.board,
|
||||||
XP_CURSOR_KEY_UP );
|
XP_CURSOR_KEY_UP );
|
||||||
return XP_TRUE;
|
return XP_TRUE;
|
||||||
|
@ -493,6 +506,7 @@ handleUp( CursesAppGlobals* globals )
|
||||||
static XP_Bool
|
static XP_Bool
|
||||||
handleDown( CursesAppGlobals* globals )
|
handleDown( CursesAppGlobals* globals )
|
||||||
{
|
{
|
||||||
|
checkAssignFocus( globals->cGlobals.game.board );
|
||||||
globals->doDraw = board_handleKey( globals->cGlobals.game.board,
|
globals->doDraw = board_handleKey( globals->cGlobals.game.board,
|
||||||
XP_CURSOR_KEY_DOWN );
|
XP_CURSOR_KEY_DOWN );
|
||||||
return XP_TRUE;
|
return XP_TRUE;
|
||||||
|
|
Loading…
Add table
Reference in a new issue