Changeset 45876 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- May 2, 2013 12:52:59 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHostComboEditor.cpp
r45873 r45876 386 386 /** 387 387 * @brief isSyntheticLCtrl 388 * @param pMsg Windows event message structure388 * @param pMsg Windows WM_[SYS]KEY* event message structure 389 389 * @return true if this is a synthetic LCtrl event, false otherwise 390 390 * This function is a heuristic to tell whether a key event is the first in … … 405 405 unsigned i; 406 406 407 if ((pMsg->lParam & 0x01FF0000) >> 16 != 0x1d /* LCtrl */) 407 Assert( pMsg->message == WM_KEYDOWN || pMsg->message == WM_SYSKEYDOWN 408 || pMsg->message == WM_KEYUP || pMsg->message == WM_SYSKEYUP); 409 if ( ((HIWORD(pMsg->lParam) & 0xFF) != 0x1d /* scan code: Control */) 410 || HIWORD(pMsg->lParam) & KF_EXTENDED) 408 411 return false; 409 412 if (!PeekMessage(&peekMsg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_NOREMOVE)) … … 415 418 && (peekMsg.message != WM_KEYUP && peekMsg.message != WM_SYSKEYUP)) 416 419 return false; 417 if ((peekMsg.lParam & 0x01FF0000) >> 16 != 0x138 /* RAlt */) 418 return false; 420 if ( ((HIWORD(peekMsg.lParam) & 0xFF) != 0x38 /* scan code: Alt */) 421 || !(HIWORD(peekMsg.lParam) & KF_EXTENDED)) 422 return false; 423 LogRel(("The current event is a left control key event (time: %d). There is a pending right alt key event (time: %d).\n", 424 (int) pMsg->time, (int) peekMsg.time)); 425 /* If we got this far then we have a key event which could potentially 426 * be a synthetic left control. Now we check to see whether the current 427 * keyboard layout actually has an AltGr key by checking whether any of 428 * the keys which might do produce a symbol when AltGr (Control + Alt) is 429 * depressed. Generally this loop will exit pretty early (it exits on the 430 * first iteration for my German layout). If there is no AltGr key in the 431 * layout then it will run right through, but that should not happen very 432 * often as we should hardly ever reach the loop in that case. 433 * 434 * In theory we could do this once and cache the result, but that involves 435 * tracking layout switches to invalidate the cache, and I don't think 436 * that the added complexity is worth the price. 437 */ 419 438 for (i = '0'; i <= VK_OEM_102; ++i) 420 439 {
Note:
See TracChangeset
for help on using the changeset viewer.