/** Handle WM_IME_COMPOSITION messages. */ static LRESULT HandleIMEComposition(HWND hwnd, WPARAM wParam, LPARAM lParam) { HIMC hIMC = ImmGetContext(hwnd); if (hIMC != NULL) { if (lParam & GCS_RESULTSTR) { /* Read result string from the IME. */ LONG len = ImmGetCompositionString(hIMC, GCS_RESULTSTR, NULL, 0); // Length is always in bytes, even in UNICODE build. TCHAR *str = (TCHAR *)_alloca(len + sizeof(TCHAR)); len = ImmGetCompositionString(hIMC, GCS_RESULTSTR, str, len); str[len / sizeof(TCHAR)] = '\0'; /* Transmit text to windowing system. */ if (len > 0) { HandleTextInput(NULL, true); // Clear marked string. HandleTextInput(FS2OTTD(str)); } SetCompositionPos(hwnd); /* Don't pass the result string on to the default window proc. */ lParam &= ~(GCS_RESULTSTR | GCS_RESULTCLAUSE | GCS_RESULTREADCLAUSE | GCS_RESULTREADSTR); } if ((lParam & GCS_COMPSTR) && DrawIMECompositionString()) { /* Read composition string from the IME. */ LONG len = ImmGetCompositionString(hIMC, GCS_COMPSTR, NULL, 0); // Length is always in bytes, even in UNICODE build. TCHAR *str = (TCHAR *)_alloca(len + sizeof(TCHAR)); len = ImmGetCompositionString(hIMC, GCS_COMPSTR, str, len); str[len / sizeof(TCHAR)] = '\0'; if (len > 0) { static char utf8_buf[1024]; convert_from_fs(str, utf8_buf, lengthof(utf8_buf)); /* Convert caret position from bytes in the input string to a position in the UTF-8 encoded string. */ LONG caret_bytes = ImmGetCompositionString(hIMC, GCS_CURSORPOS, NULL, 0); const char *caret = utf8_buf; for (const TCHAR *c = str; *c != '\0' && *caret != '\0' && caret_bytes > 0; c++, caret_bytes--) { /* Skip DBCS lead bytes or leading surrogates. */ #ifdef UNICODE if (Utf16IsLeadSurrogate(*c)) { #else if (IsDBCSLeadByte(*c)) { #endif c++; caret_bytes--; } Utf8Consume(&caret); } HandleTextInput(utf8_buf, true, caret); } else { HandleTextInput(NULL, true); } lParam &= ~(GCS_COMPSTR | GCS_COMPATTR | GCS_COMPCLAUSE | GCS_CURSORPOS | GCS_DELTASTART); } }
bool Widget::TriggerTextInput(const TextInputEvent &event, bool handled) { HandleTextInput(event); if (!handled) handled = onTextInput.emit(event); if (GetContainer()) handled = GetContainer()->TriggerTextInput(event, handled); return handled; }
bool Widget::TriggerTextInput(const TextInputEvent &event, bool emit) { HandleTextInput(event); if (emit) emit = !onTextInput.emit(event); if (GetContainer()) GetContainer()->TriggerTextInput(event, emit); return !emit; }
void GetPlayerKeyBoardInputForBriefingRoomEnterHomePage( void ) { InputAtom InputEvent; POINT MousePos; GetCursorPos(&MousePos); ScreenToClient(ghWindow, &MousePos); // In window coords! while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) { // HOOK INTO MOUSE HOOKS /* switch(InputEvent.usEvent) { case LEFT_BUTTON_DOWN: MouseSystemHook(LEFT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); break; case LEFT_BUTTON_UP: MouseSystemHook(LEFT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y ,_LeftButtonDown, _RightButtonDown); break; case RIGHT_BUTTON_DOWN: MouseSystemHook(RIGHT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); break; case RIGHT_BUTTON_UP: MouseSystemHook(RIGHT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); break; } */ if( !HandleTextInput( &InputEvent ) && (InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT || InputEvent.usEvent == KEY_UP ) ) { switch( InputEvent.usParam ) { case (( ENTER ) ): if(( InputEvent.usEvent == KEY_UP ) ) { // return hit, check to see if current player activation string is a valid one ProcessPlayerInputActivationBriefingRoomEnterString( ); fNewCharInActivationBriefingRoomEnterString = TRUE; } break; case (( ESC )): HandleLapTopESCKey(); // WANNE: Fix for proper closing of the IMP laptop page LeaveLapTopScreen( ); break; default: if(InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT ) { HandleBriefingRoomEnterTextEvent( InputEvent.usParam ); } break; } } } return; }
void GetPlayerKeyBoardInputForIMPHomePage( void ) { InputAtom InputEvent; POINT MousePos; GetCursorPos(&MousePos); while (DequeueEvent(&InputEvent) == TRUE) { // HOOK INTO MOUSE HOOKS /* switch(InputEvent.usEvent) { case LEFT_BUTTON_DOWN: MouseSystemHook(LEFT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); break; case LEFT_BUTTON_UP: MouseSystemHook(LEFT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y ,_LeftButtonDown, _RightButtonDown); break; case RIGHT_BUTTON_DOWN: MouseSystemHook(RIGHT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); break; case RIGHT_BUTTON_UP: MouseSystemHook(RIGHT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); break; } */ if( !HandleTextInput( &InputEvent ) && (InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT || InputEvent.usEvent == KEY_UP ) ) { switch( InputEvent.usParam ) { case (( ENTER ) ): if(( InputEvent.usEvent == KEY_UP ) ) { // return hit, check to see if current player activation string is a valid one ProcessPlayerInputActivationString( ); fNewCharInActivationString = TRUE; } break; case (( ESC )): LeaveLapTopScreen( ); break; default: if(InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT ) { HandleTextEvent( InputEvent.usParam ); } break; } } } return; }
void GetPlayerKeyBoardInputForIMPHomePage( void ) { InputAtom InputEvent; POINT MousePos; GetCursorPos(&MousePos); ScreenToClient(ghWindow, &MousePos); // In window coords! while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) { if( !HandleTextInput( &InputEvent ) && (InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT || InputEvent.usEvent == KEY_UP ) ) { switch( InputEvent.usParam ) { case (( ENTER ) ): if(( InputEvent.usEvent == KEY_UP ) ) { // return hit, check to see if current player activation string is a valid one ProcessPlayerInputActivationString( ); fNewCharInActivationString = TRUE; } break; case (( ESC )): HandleLapTopESCKey(); // WANNE: Fix for proper closing of the IMP laptop page LeaveLapTopScreen( ); break; default: if(InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT ) { HandleTextEvent( InputEvent.usParam ); } break; } } } return; }
UINT32 MPChatScreenHandle( ) { InputAtom InputEvent; if ( gfNewChatBox ) { // If in game screen.... if ( ( gfStartedFromGameScreen )||( gfStartedFromMapScreen ) ) { //UINT32 uiDestPitchBYTES, uiSrcPitchBYTES; //UINT8 *pDestBuf, *pSrcBuf; if( gfStartedFromGameScreen ) { HandleTacticalUILoseCursorFromOtherScreen( ); } else { HandleMAPUILoseCursorFromOtherScreen( ); } gfStartedFromGameScreen = FALSE; gfStartedFromMapScreen = FALSE; } gfNewChatBox = FALSE; return( MP_CHAT_SCREEN ); } UnmarkButtonsDirty( ); // Render the box! if ( gChatBox.fRenderBox ) { // Render the Background ( this includes the text string) RenderMercPopUpBoxFromIndex( gChatBox.iBoxId, gChatBox.sX, gChatBox.sY, FRAME_BUFFER ); UINT16 usWidth = StringPixLength( gzMPChatboxText[0], CHATBOX_FONT_TITLE ); int usPosY = 0; int usPosX = 0; usPosY = gChatBox.sY + 10; usPosX = gChatBox.sX + ((gChatBox.usWidth - usWidth) / 2); DrawTextToScreen( gzMPChatboxText[0], usPosX, usPosY, usWidth, CHATBOX_FONT_TITLE, CHATBOX_FONT_COLOR, DEFAULT_SHADOW, FALSE, CENTER_JUSTIFIED | TEXT_SHADOWED ); // Render the toggle button strings for(UINT8 cnt=0; cnt<NUM_CHAT_TOGGLES; cnt++) { GUI_BUTTON* btn = ButtonList[ guiChatToggles[ cnt ] ]; usPosX = btn->XLoc + 12 + 10; usPosY = btn->YLoc; usWidth = StringPixLength( gzMPChatToggleText[ cnt ], CHATBOX_FONT_TOGGLE ); DrawTextToScreen( gzMPChatToggleText[ cnt ], usPosX, usPosY, usWidth, CHATBOX_FONT_TOGGLE, CHATBOX_FONT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); } if (gIncludeChatLog) { // draw chatbox HVOBJECT hHandle; // get and blt panel GetVideoObject(&hHandle, guiCHATLOGIMG ); BltVideoObject( FRAME_BUFFER , hHandle, 0, gChatMessageLogRegion.iLeft, gChatMessageLogRegion.iTop, VO_BLT_SRCTRANSPARENCY,NULL ); BltVideoObject( FRAME_BUFFER , hHandle, 1, gChatMessageLogRegion.iRight+CHATBOX_SLIDER_GAP, gChatMessageLogRegion.iTop, VO_BLT_SRCTRANSPARENCY,NULL ); // draw slider DisplayChatLogScrollBarSlider( ); // draw chat log text DisplayStringsInChatLogMessageList(); } } MarkButtonsDirty(); EnableDisableChatLogScrollButtonsAndRegions(); // Render buttons RenderButtons( ); // render text boxes //SaveFontSettings(); SetFontDestBuffer( FRAME_BUFFER, gChatTextBoxRegion.iLeft , gChatTextBoxRegion.iTop , gChatTextBoxRegion.iRight , gChatTextBoxRegion.iBottom, FALSE ); RenderAllTextFields(); // textbox system call SetFontDestBuffer( FRAME_BUFFER, 0 , 0 , SCREEN_WIDTH , SCREEN_HEIGHT , FALSE ); //RestoreFontSettings(); EndFrameBufferRender( ); // carter, need key shortcuts for clearing up message boxes // Check for esc bool bHandled; while (DequeueEvent(&InputEvent) == TRUE) { bHandled = false; if(InputEvent.usEvent == KEY_DOWN ) { if( ( InputEvent.usParam == ESC ) ) { // Exit messagebox gChatBox.bHandled = MSG_BOX_RETURN_NO; memset(gszChatBoxInputString,0,sizeof(CHAR16)*255); bHandled = true; } if( InputEvent.usParam == ENTER ) { // retrieve the string from the text box Get16BitStringFromField( 0, gszChatBoxInputString, 255 ); // these indexes are based on the order created // Exit messagebox gChatBox.bHandled = MSG_BOX_RETURN_OK; bHandled = true; } // OJW - 20090403 - add better key control UINT8 ubDesiredMessageIndex; UINT8 ubNumMessages; ubNumMessages = GetRangeOfChatLogMessages(); if ( ubNumMessages > MAX_CHATLOG_MESSAGES ) { if (InputEvent.usParam == PGUP) { //move up a page ChatScreenMsgScrollUp( MAX_CHATLOG_MESSAGES ); bHandled = true; } if (InputEvent.usParam == PGDN) { // move down a page ChatScreenMsgScrollDown( MAX_CHATLOG_MESSAGES ); bHandled = true; } if (InputEvent.usParam == HOME) { // move to the beginning ChangeCurrentChatScreenMessageIndex( 0 ); bHandled = true; } if (InputEvent.usParam == END) { // move to end ubDesiredMessageIndex = ubNumMessages - MAX_CHATLOG_MESSAGES; ChangeCurrentChatScreenMessageIndex( ubDesiredMessageIndex ); bHandled = true; } } } // send to text box if (!bHandled) HandleTextInput( &InputEvent ); } if ( gChatBox.bHandled ) { SetRenderFlags( RENDER_FLAG_FULL ); return( ExitChatBox( gChatBox.bHandled ) ); } return( MP_CHAT_SCREEN ); }
UINT32 LoadSaveScreenHandle(void) { FDLG_LIST *FListNode; INT32 x; InputAtom DialogEvent; if( fEnteringLoadSaveScreen ) { LoadSaveScreenEntry(); } if( gbCurrentFileIOStatus ) //loading or saving map { UINT32 uiScreen; uiScreen = ProcessFileIO(); if( uiScreen == EDIT_SCREEN && gbCurrentFileIOStatus == LOADING_MAP ) RemoveProgressBar( 0 ); return uiScreen; } if( gubMessageBoxStatus ) { if( MessageBoxHandled() ) return ProcessLoadSaveScreenMessageBoxResult(); return LOADSAVE_SCREEN; } //handle all key input. while( DequeueEvent(&DialogEvent) ) { if( !HandleTextInput(&DialogEvent) && (DialogEvent.usEvent == KEY_DOWN || DialogEvent.usEvent == KEY_REPEAT) ) { HandleMainKeyEvents( &DialogEvent ); } } HandleMouseWheelEvents();//dnl ch36 150909 DrawFileDialog(); // Skip to first filename to show FListNode = FileList; for(x=0;x<iTopFileShown && x<iTotalFiles && FListNode != NULL;x++) { FListNode = FListNode->pNext; } // Show up to 8 filenames in the window SetFont( FONT12POINT1 ); if( gfNoFiles ) { SetFontForeground( FONT_LTRED ); SetFontBackground( 142 ); mprintf( iScreenWidthOffset + 226, iScreenHeightOffset + 126, L"NO FILES IN \\MAPS DIRECTORY" ); } else for(x=iTopFileShown;x<(iTopFileShown+8) && x<iTotalFiles && FListNode != NULL; x++) { if( !EditingText() && x == iCurrFileShown ) { SetFontForeground( FONT_GRAY2 ); SetFontBackground( FONT_METALGRAY ); } else { SetFontForeground( FONT_BLACK ); SetFontBackground( 142 ); } mprintf( iScreenWidthOffset + 186,(iScreenHeightOffset + 73+ (x-iTopFileShown)*15 ), L"%S", FListNode->FileInfo.zFileName); FListNode = FListNode->pNext; } RenderAllTextFields(); InvalidateScreen(); ExecuteBaseDirtyRectQueue(); EndFrameBufferRender(); switch( iFDlgState ) { case DIALOG_CANCEL: RemoveFileDialog(); fEnteringLoadSaveScreen = TRUE; return EDIT_SCREEN; case DIALOG_DELETE: sprintf( gszCurrFilename, "MAPS\\%S", gzFilename ); if( GetFileFirst(gszCurrFilename, &FileInfo) ) { CHAR16 str[40]; if( FileInfo.uiFileAttribs & (FILE_IS_READONLY|FILE_IS_HIDDEN|FILE_IS_SYSTEM) ) { swprintf( str, L" Delete READ-ONLY file %s? ", gzFilename ); gfReadOnly = TRUE; } else swprintf( str, L" Delete file %s? ", gzFilename ); gfDeleteFile = TRUE; CreateMessageBox( str ); } return LOADSAVE_SCREEN; case DIALOG_SAVE://dnl ch37 230909 { if(!ExtractFilenameFromFields()) { CreateMessageBox(L" Illegal filename. Try another filename? "); gfIllegalName = TRUE; iFDlgState = DIALOG_NONE; return(LOADSAVE_SCREEN); } sprintf(gszCurrFilename, "MAPS\\%S", gzFilename); gfFileExists = FALSE; #ifndef USE_VFS gfReadOnly = FALSE; if(FileExists(gszCurrFilename)) { gfFileExists = TRUE; if(GetFileFirst(gszCurrFilename, &FileInfo)) { if(FileInfo.uiFileAttribs & (FILE_IS_READONLY|FILE_IS_DIRECTORY|FILE_IS_HIDDEN|FILE_IS_SYSTEM|FILE_IS_OFFLINE|FILE_IS_TEMPORARY)) gfReadOnly = TRUE; GetFileClose(&FileInfo); } } #else gfReadOnly = TRUE; vfs::CProfileStack* st = getVFS()->getProfileStack(); vfs::CProfileStack::Iterator it = st->begin(); while(!it.end()) { vfs::CVirtualProfile* prof = it.value(); if(prof->cWritable == true) { gfReadOnly = FALSE; vfs::Path const& path = gszCurrFilename; vfs::IBaseFile *file = prof->getFile(path); if(file) { gfFileExists = TRUE; if(file->implementsWritable() == false) gfReadOnly = TRUE; } break; } it.next(); } #endif if(gfReadOnly) { CreateMessageBox(L" File is read only! Choose a different name? "); return( LOADSAVE_SCREEN); } else if(gfFileExists) { CreateMessageBox(L" File exists, Overwrite? "); return(LOADSAVE_SCREEN); } RemoveFileDialog(); gbCurrentFileIOStatus = INITIATE_MAP_SAVE; return(LOADSAVE_SCREEN); } case DIALOG_LOAD: if( !ExtractFilenameFromFields() ) { CreateMessageBox( L" Illegal filename. Try another filename? " ); gfIllegalName = TRUE; iFDlgState = DIALOG_NONE; return LOADSAVE_SCREEN; } RemoveFileDialog(); CreateProgressBar( 0, iScreenWidthOffset + 118, iScreenHeightOffset + 183, iScreenWidthOffset + 522, iScreenHeightOffset + 202 ); DefineProgressBarPanel( 0, 65, 79, 94, iScreenWidthOffset + 100, iScreenHeightOffset + 155, iScreenWidthOffset + 540, iScreenHeightOffset + 235 ); swprintf( zOrigName, L"Loading map: %s", gzFilename ); SetProgressBarTitle( 0, zOrigName, BLOCKFONT2, FONT_RED, FONT_NEARBLACK ); gbCurrentFileIOStatus = INITIATE_MAP_LOAD; return LOADSAVE_SCREEN ; default: iFDlgState = DIALOG_NONE; } iFDlgState = DIALOG_NONE; return LOADSAVE_SCREEN ; }
UINT32 LoadSaveScreenHandle(void) { FDLG_LIST *FListNode; INT32 x; InputAtom DialogEvent; if( fEnteringLoadSaveScreen ) { LoadSaveScreenEntry(); } if( gbCurrentFileIOStatus ) //loading or saving map { UINT32 uiScreen; uiScreen = ProcessFileIO(); if( uiScreen == EDIT_SCREEN && gbCurrentFileIOStatus == LOADING_MAP ) RemoveProgressBar( 0 ); return uiScreen; } if( gubMessageBoxStatus ) { if( MessageBoxHandled() ) return ProcessLoadSaveScreenMessageBoxResult(); return LOADSAVE_SCREEN; } //handle all key input. while( DequeueEvent(&DialogEvent) ) { if( !HandleTextInput(&DialogEvent) && (DialogEvent.usEvent == KEY_DOWN || DialogEvent.usEvent == KEY_REPEAT) ) { HandleMainKeyEvents( &DialogEvent ); } } DrawFileDialog(); // Skip to first filename to show FListNode = FileList; for(x=0; x<iTopFileShown && x<iTotalFiles && FListNode != NULL; x++) { FListNode = FListNode->pNext; } // Show up to 8 filenames in the window SetFont( FONT12POINT1 ); if( gfNoFiles ) { SetFontForeground( FONT_LTRED ); SetFontBackground( 142 ); mprintf( 226, 126, L"NO FILES IN \\MAPS DIRECTORY" ); } else for(x=iTopFileShown; x<(iTopFileShown+8) && x<iTotalFiles && FListNode != NULL; x++) { if( !EditingText() && x == iCurrFileShown ) { SetFontForeground( FONT_GRAY2 ); SetFontBackground( FONT_METALGRAY ); } else { SetFontForeground( FONT_BLACK ); SetFontBackground( 142 ); } mprintf( 186,(73+ (x-iTopFileShown)*15 ), L"%S", FListNode->FileInfo.zFileName); FListNode = FListNode->pNext; } RenderAllTextFields(); InvalidateScreen(); ExecuteBaseDirtyRectQueue(); EndFrameBufferRender(); switch( iFDlgState ) { case DIALOG_CANCEL: RemoveFileDialog(); fEnteringLoadSaveScreen = TRUE; return EDIT_SCREEN; case DIALOG_DELETE: sprintf( gszCurrFilename, "MAPS\\%S", gzFilename ); if( GetFileFirst(gszCurrFilename, &FileInfo) ) { UINT16 str[40]; if( FileInfo.uiFileAttribs & (FILE_IS_READONLY|FILE_IS_HIDDEN|FILE_IS_SYSTEM) ) { swprintf( str, L" Delete READ-ONLY file %s? ", gzFilename ); gfReadOnly = TRUE; } else swprintf( str, L" Delete file %s? ", gzFilename ); gfDeleteFile = TRUE; CreateMessageBox( str ); } return LOADSAVE_SCREEN; case DIALOG_SAVE: if( !ExtractFilenameFromFields() ) { CreateMessageBox( L" Illegal filename. Try another filename? " ); gfIllegalName = TRUE; iFDlgState = DIALOG_NONE; return LOADSAVE_SCREEN; } sprintf( gszCurrFilename, "MAPS\\%S", gzFilename ); if ( FileExists( gszCurrFilename ) ) { gfFileExists = TRUE; gfReadOnly = FALSE; if( GetFileFirst(gszCurrFilename, &FileInfo) ) { if( FileInfo.uiFileAttribs & (FILE_IS_READONLY|FILE_IS_DIRECTORY|FILE_IS_HIDDEN|FILE_IS_SYSTEM|FILE_IS_OFFLINE|FILE_IS_TEMPORARY) ) gfReadOnly = TRUE; GetFileClose(&FileInfo); } if( gfReadOnly ) CreateMessageBox( L" File is read only! Choose a different name? " ); else CreateMessageBox( L" File exists, Overwrite? " ); return( LOADSAVE_SCREEN ); } RemoveFileDialog(); gbCurrentFileIOStatus = INITIATE_MAP_SAVE; return LOADSAVE_SCREEN ; case DIALOG_LOAD: if( !ExtractFilenameFromFields() ) { CreateMessageBox( L" Illegal filename. Try another filename? " ); gfIllegalName = TRUE; iFDlgState = DIALOG_NONE; return LOADSAVE_SCREEN; } RemoveFileDialog(); CreateProgressBar( 0, 118, 183, 522, 202 ); DefineProgressBarPanel( 0, 65, 79, 94, 100, 155, 540, 235 ); swprintf( zOrigName, L"Loading map: %s", gzFilename ); SetProgressBarTitle( 0, zOrigName, BLOCKFONT2, FONT_RED, FONT_NEARBLACK ); gbCurrentFileIOStatus = INITIATE_MAP_LOAD; return LOADSAVE_SCREEN ; default: iFDlgState = DIALOG_NONE; } iFDlgState = DIALOG_NONE; return LOADSAVE_SCREEN ; }
void GetPlayerKeyBoardInputForIMPBeginScreen( void ) { InputAtom InputEvent; POINT MousePos; // get the current curosr position, might just need it. GetCursorPos(&MousePos); // handle input events while( DequeueEvent(&InputEvent) ) { /* // HOOK INTO MOUSE HOOKS switch(InputEvent.usEvent) { case LEFT_BUTTON_DOWN: MouseSystemHook(LEFT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); break; case LEFT_BUTTON_UP: MouseSystemHook(LEFT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y ,_LeftButtonDown, _RightButtonDown); break; case RIGHT_BUTTON_DOWN: MouseSystemHook(RIGHT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); break; case RIGHT_BUTTON_UP: MouseSystemHook(RIGHT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown); break; } */ if( !HandleTextInput( &InputEvent ) && (InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT) ) { switch( InputEvent.usParam ) { case (( ENTER )): // check to see if gender was highlighted..if so, select it if( FEMALE_GENDER_SELECT == ubTextEnterMode ) { bGenderFlag = IMP_FEMALE; } else if( MALE_GENDER_SELECT == ubTextEnterMode ) { bGenderFlag = IMP_MALE; } // increment to next selection box IncrementTextEnterMode( ); fNewCharInString = TRUE; break; case( SPACE ): // handle space bar if( FEMALE_GENDER_SELECT == ubTextEnterMode ) { bGenderFlag = IMP_FEMALE; DecrementTextEnterMode( ); } else if( MALE_GENDER_SELECT == ubTextEnterMode ) { bGenderFlag = IMP_MALE; IncrementTextEnterMode( ); } else { HandleBeginScreenTextEvent( InputEvent.usParam ); } fNewCharInString = TRUE; break; case (( ESC )): LeaveLapTopScreen( ); break; case (( TAB )): // tab hit, increment to next selection box IncrementTextEnterMode( ); fNewCharInString = TRUE; break; case ( 265 ): // tab and shift DecrementTextEnterMode( ); fNewCharInString = TRUE; break; default: HandleBeginScreenTextEvent( InputEvent.usParam ); break; } } } return; }