Changeset 2768 for trunk/synergy/lib/platform/CPMSynergyHook.cpp
- Timestamp:
- Aug 20, 2006, 8:11:44 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/synergy/lib/platform/CPMSynergyHook.cpp
r2764 r2768 22 22 #include <InnoTekLIBC/FastInfoBlocks.h> 23 23 #else 24 unsigned long fibGetMsCount(void 24 unsigned long fibGetMsCount(void) 25 25 { 26 26 ULONG ul = 0; … … 50 50 } 51 51 52 #endif 52 #endif 53 53 54 54 // … … 542 542 * @param hab The hab of the current thread. 543 543 * @param pqmsg Where to put the message. 544 * @param fSkip Skip message flag. 544 * @param fSkip Skip message flag. 545 545 * If TRUE we should just skip a message (pqmsg is NULL). If no futher 546 546 * messages are queued, we must release the hook. … … 567 567 } else { 568 568 *pqmsg = g_qmsg; 569 } 570 569 if (pqmsg->msg == WM_VIOCHAR) { 570 /* mp1.s1: KC_ flags. 571 * mp1.c3: repeat 572 * mp1.c4: scancode 573 * mp2.c1: translated char 574 * mp2.c2: translated scancode 575 * mp2.s2: KDD_ flags. 576 */ 577 KbdPacket[0].monFlags = 0; // no monitor flag 578 KbdPacket[0].scancode = CHAR4FROMMP(pqmsg->mp1); 579 KbdPacket[0].xlatedchar = CHAR1FROMMP(pqmsg->mp2); 580 KbdPacket[0].xlatedscan = CHAR2FROMMP(pqmsg->mp2); 581 KbdPacket[0].time = pqmsg->time; 582 KbdPacket[0].ddFlags = SHORT2FROMMP(pqmsg->mp2); 583 /** @todo extended stuff, keypad, workarounds. see pmvnc. */ 584 } 585 } 586 587 /* 588 * We're not recording, so no chance of a feedback loop here. 589 * This doesn't seem to work, bah! 590 */ 591 if (pfNoRecord) { 592 *pfNoRecord = FALSE; 593 } 571 594 return TRUE; 572 595 } … … 587 610 assert(g_fSynergyInitialized); 588 611 if (g_fSynergyInitialized) { 589 /* 612 /* 590 613 * Reset the event semaphore and queue the message for MsgInputHook. 591 614 */ … … 609 632 610 633 /* 611 * It took a bit longer than expected. We'll wait for some 2-3 634 * It took a bit longer than expected. We'll wait for some 2-3 612 635 * seconds before we give up. This might be a bit paranoid, but 613 636 * I'd rather drop a message than locking up PM. … … 623 646 if (rc != ERROR_TIMEOUT && rc != ERROR_SEM_TIMEOUT && rc != ERROR_INTERRUPT) { 624 647 break; 625 } 648 } 626 649 if (fibGetMsCount() - ulStart > 2500) { 627 650 break; … … 630 653 } 631 654 632 /* 633 * Since we probably didn't manage to inject the message, we should 634 * release the hook to make sure we're not overwriting g_qmsg while 655 /* 656 * Since we probably didn't manage to inject the message, we should 657 * release the hook to make sure we're not overwriting g_qmsg while 635 658 * some other thread is reading it from MsgInputHook. 636 659 */ … … 639 662 pszRet = g_pszErrorMsg; 640 663 return pszRet ? pszRet : "timed out"; 641 } 664 } 642 665 pszRet = "WinSetHook failed"; 643 666 } else {
Note:
See TracChangeset
for help on using the changeset viewer.