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.
| Method | Description |
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
| Client | Requires Windows XP, Windows 2000 Professional, or Windows NT Workstation. |
| Redistributable | Requires TSF 1.0 on Windows NT 4.0, Windows 2000 Professional and Windows MeWindows 98. |
| Header | Declared in Msctf.idl and Msctf.h. |
| DLL | Requires Mscandui.dll. |
See Also
ITfContext
ITfSource
ITfSource::AdviseSink
Send comments about this topic to Microsoft
Build date: 12/17/2008