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
| Minimum supported client | Windows 2000 Professional |
| Minimum supported server | Windows 2000 Server |
| Redistributable | TSF 1.0 onWindows NT 4.0,Windows 2000 ProfessionalandWindows MeWindows 98 |
| Header | Msctf.idl and Msctf.h |
| DLL | Mscandui.dll |
See Also
-
ITfContext
-
ITfSource
-
ITfSource::AdviseSink
Send comments about this topic to Microsoft
Build date: 7/14/2009