Fix bugs in recent focus/key changes.

This commit is contained in:
ehouse 2007-01-12 03:37:30 +00:00
parent a056dad08c
commit c1affa34d1

View file

@ -2638,7 +2638,11 @@ board_handleKeyDown( BoardCtxt* board, XP_Key key, XP_Bool* pHandled )
*pHandled = draw; *pHandled = draw;
} }
} else if ( board->focussed != OBJ_NONE ) { } else if ( board->focussed != OBJ_NONE ) {
draw = handleFocusKeyUp( board, key, XP_TRUE, pHandled ) || draw; if ( board->focusHasDived && (key == XP_RAISEFOCUS_KEY) ) {
*pHandled = XP_TRUE;
} else {
draw = handleFocusKeyUp( board, key, XP_TRUE, pHandled ) || draw;
}
} }
return draw; return draw;
@ -2647,13 +2651,16 @@ board_handleKeyDown( BoardCtxt* board, XP_Key key, XP_Bool* pHandled )
XP_Bool XP_Bool
board_handleKeyRepeat( BoardCtxt* board, XP_Key key, XP_Bool* handled ) board_handleKeyRepeat( BoardCtxt* board, XP_Key key, XP_Bool* handled )
{ {
XP_Bool upHandled, downHandled;
XP_Bool draw; XP_Bool draw;
draw = board_handleKeyUp( board, key, &upHandled ); if ( key == XP_RETURN_KEY ) {
draw = board_handleKeyDown( board, key, &downHandled ) || draw; *handled = XP_FALSE;
} else {
*handled = upHandled || downHandled; XP_Bool upHandled, downHandled;
draw = board_handleKeyUp( board, key, &upHandled );
draw = board_handleKeyDown( board, key, &downHandled ) || draw;
*handled = upHandled || downHandled;
}
return draw; return draw;
} }
#endif /* KEYBOARD_NAV */ #endif /* KEYBOARD_NAV */
@ -2887,25 +2894,25 @@ figureNextLoc( BoardCtxt* board, XP_Key cursorKey,
end = max; end = max;
break; break;
default: default:
XP_ASSERT( XP_FALSE ); XP_LOGF( "%s: odd cursor key: %d", __FUNCTION__, cursorKey );
} }
XP_ASSERT( incr != 0 ); if ( incr != 0 ) {
for ( ; ; ) {
for ( ; ; ) { if ( *useWhat == end ) {
if ( *useWhat == end ) {
#ifdef KEYBOARD_NAV #ifdef KEYBOARD_NAV
if ( !!pUp ) { if ( !!pUp ) {
*pUp = XP_TRUE; *pUp = XP_TRUE;
} }
#endif #endif
break; break;
} }
result = XP_TRUE; result = XP_TRUE;
*useWhat += incr; *useWhat += incr;
if ( forceFirst || !cellOccupied( board, if ( forceFirst
*colP, *rowP, inclPending ) ) { || !cellOccupied( board, *colP, *rowP, inclPending ) ) {
break; break;
}
} }
} }
} }