BOOL CCustomComboBoxEx::PreTranslateMessage(MSG* pMsg) { if(pMsg->message == WM_KEYDOWN) { if(_HandleKeyDown(static_cast<TCHAR>(pMsg->wParam))) return TRUE; } else if((pMsg->message == WM_KEYUP) || (pMsg->message == WM_CHAR)) { if(_HandleKeyUp(static_cast<TCHAR>(pMsg->wParam))) return TRUE; } return CComboBoxEx::PreTranslateMessage(pMsg); }
void CannaLooper::MessageReceived(BMessage* msg) { SERIAL_PRINT(("CannaLooper: Entering MessageReceived() what=%.4s\n", (char*)&msg->what)); switch (msg->what) { case B_KEY_DOWN: case NUM_SELECTED_FROM_KOUHO_WIN: _HandleKeyDown(msg); break; case B_INPUT_METHOD_EVENT: uint32 opcode, result; msg->FindInt32("be:opcode", (int32*)&opcode); switch (opcode) { case B_INPUT_METHOD_LOCATION_REQUEST: _HandleLocationReply(msg); break; case B_INPUT_METHOD_STOPPED: SERIAL_PRINT(("CannaLooper: B_INPUT_METHOD_STOPPED " "received\n")); _ForceKakutei(); break; } break; case CANNA_METHOD_ACTIVATED: SERIAL_PRINT(("CannaLooper: CANNA_METHOD_ACTIVATED received\n")); _HandleMethodActivated(msg->HasBool("active")); break; case MODE_CHANGED_FROM_PALETTE: _ForceKakutei(); int32 mode; msg->FindInt32("mode", &mode); result = fCanna->ChangeMode(mode); _ProcessResult(result); break; case B_ABOUT_REQUESTED: { SERIAL_PRINT(("CannaLooper: B_ABOUT_REQUESTED received\n")); BAlert* panel = new BAlert( "", "Canna Input Method\n" " by Masao Kawamura 1999\n\n" "Canna\n" " Copyright 1992 NEC Corporation, Tokyo, Japan\n" " Special thanks to T.Murai for porting\n", "OK"); panel->Go(); break; } case RELOAD_INIT_FILE: _ForceKakutei(); fCanna->Reset(); break; case ARROW_KEYS_FLIPPED: { BMenuItem* item = fMenu->FindItem(ARROW_KEYS_FLIPPED); gSettings.convert_arrowkey = !gSettings.convert_arrowkey; item->SetMarked(gSettings.convert_arrowkey); fCanna->SetConvertArrowKey(gSettings.convert_arrowkey); break; } default: BLooper::MessageReceived(msg); break; } }