Ignore:
Timestamp:
Aug 20, 2006, 8:11:44 AM (19 years ago)
Author:
bird
Message:

Expanded m_client to 64-bit. Finally managed to hack together a getKeyMap and fakeKey for PM.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/synergy/lib/platform/CPMSynergyHook.cpp

    r2764 r2768  
    2222#include <InnoTekLIBC/FastInfoBlocks.h>
    2323#else
    24 unsigned long fibGetMsCount(void )
     24unsigned long fibGetMsCount(void)
    2525{
    2626    ULONG ul = 0;
     
    5050}
    5151
    52 #endif 
     52#endif
    5353
    5454//
     
    542542 * @param   hab         The hab of the current thread.
    543543 * @param   pqmsg       Where to put the message.
    544  * @param   fSkip       Skip message flag. 
     544 * @param   fSkip       Skip message flag.
    545545 *                      If TRUE we should just skip a message (pqmsg is NULL). If no futher
    546546 *                      messages are queued, we must release the hook.
     
    567567    } else {
    568568        *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    }
    571594    return TRUE;
    572595}
     
    587610    assert(g_fSynergyInitialized);
    588611    if (g_fSynergyInitialized) {
    589         /* 
     612        /*
    590613         * Reset the event semaphore and queue the message for MsgInputHook.
    591614         */
     
    609632
    610633                /*
    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
    612635                 * seconds before we give up. This might be a bit paranoid, but
    613636                 * I'd rather drop a message than locking up PM.
     
    623646                        if (rc != ERROR_TIMEOUT && rc != ERROR_SEM_TIMEOUT && rc != ERROR_INTERRUPT) {
    624647                            break;
    625                         } 
     648                        }
    626649                        if (fibGetMsCount() - ulStart > 2500) {
    627650                            break;
     
    630653                }
    631654
    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
    635658                 * some other thread is reading it from MsgInputHook.
    636659                 */
     
    639662                pszRet = g_pszErrorMsg;
    640663                return pszRet ? pszRet : "timed out";
    641             } 
     664            }
    642665            pszRet = "WinSetHook failed";
    643666        } else {
Note: See TracChangeset for help on using the changeset viewer.