How can SIP Input Method send CTRL+char key (to enable Cut, Copy, Paste)

How can SIP Input Method send CTRL+char key (to enable Cut, Copy, Paste)

Post by Shai Ena » Fri, 19 Jul 2002 19:39:26



Hi,

I can't figure out how to have my IM send CTRL+char key so shortcuts like
Ctrl+X and Ctrl+V for Cut and Paste will work. I saw that the default
English keyboard does succeed.

What I do: In LButtonUp, for alpha numeric chars, if Control is pressed I'm
trying to use IIMCallback::SendCharEvents but it doesn't work. See the code
snipet below.

Any ideas?
Thanks,
Shai
---------------------------
...
if ( m_bControlPressed && _istalnum(pkeyHit->tchar) ) // send CTRL+alpha
numric key
{
    UINT* pnChar = NULL;
    UINT nKeyState = KeyShiftAnyCtrlFlag;
    ///// UINT nKeyState = KeyShiftAnyCtrlFlag; | KeyShiftNoCharacterFlag;
// Doesn't work too

    if (m_bShiftPressed ^ m_bCapsPressed)
        nKeyState |= KeyShiftAnyShiftFlag;

    // VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39)
    // VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A)
    // So for lowercase char must convert and send VK_A - VK_Z
    UINT vk = pkeyHit->tchar;
    if ( _istlower(pkeyHit->tchar) )
        vk = towupper(pkeyHit->tchar);

    UINT nChar = pkeyHit->tchar;
    m_spIMCallback->SendCharEvents(vk, nKeyState | KeyStateDownFlag, 0,
&nKeyState, &nChar );

Quote:}

...