Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
TSF Reference
TSF Interfaces

  Switch on low bandwidth view
ITfContextKeyEventSink Interface

The ITfContextKeyEventSink interface is implemented by a text service to receive keyboard event notifications that occur in an input context. This keyboard event sink differs from the ITfKeyEventSink keyboard event sink in that the keyboard events are passed to ITfContextKeyEventSink after having been preprocessed by the ITfKeyEventSink event sink. Preserved key events and filtered key events are not passed to the ITfContextKeyEventSink event sink.

This event sink is installed by ITfSource::AdviseSink with IID_ITfContextKeyEventSink.

Methods

The ITfContextKeyEventSink interface inherits the methods of the IUnknown interface.

In addition, ITfContextKeyEventSink defines the following methods.

MethodDescription

OnKeyDown

Called when a key down event occurs.

OnKeyUp

Called when a key up event occurs.

OnTestKeyDown

Called to determine if a text service will handle a key down event.

OnTestKeyUp

Called to determine if a text service will handle a key up event.

Examples


HRESULT hr;
ITfSource *pSource;

hr = pContext->QueryInterface(IID_ITfSource, (LPVOID*)&pSource);
if(SUCCEEDED(hr))
{
    hr = pSource->AdviseSink(IID_ITfContextKeyEventSink, NULL, &m_dwContextKeyEventSinkCookie);
    
    pSource->Release();
}

HRESULT hr;
ITfSource *pSource;

hr = pContext->QueryInterface(IID_ITfSource, (LPVOID*)&pSource);
if(SUCCEEDED(hr))
{
    hr = pSource->UnadviseSink(m_dwContextKeyEventSinkCookie);
    
    pSource->Release();
}

Requirements

ClientRequires Windows XP, Windows 2000 Professional, or Windows NT Workstation.
RedistributableRequires TSF 1.0 on Windows NT 4.0, Windows 2000 Professional and Windows MeWindows 98.
HeaderDeclared in Msctf.idl and Msctf.h.
DLLRequires Mscandui.dll.

See Also

ITfContext
ITfSource
ITfSource::AdviseSink


Send comments about this topic to Microsoft

Build date: 12/17/2008

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker