ITVViewer::WantKeys

[This is preliminary documentation and subject to change.]

The WantKeys method sets whether WebTV for Windows traps keystrokes or passes them to the window with focus.

HRESULT WantKeys(
  int nKeys  
);
 

Parameters

nKeys
A flag that specifies which type of key events WebTV for Windows passes to the focus window. This can be a combination of the following values.
Value Meaning
keNumKeys WebTV for Windows passes number key (0-9) events to the focus window.
kePageKeys WebTV for Windows passes page key (PageUp/PageDown) events to the focus window.
keNoKeys WebTV for Windows traps both page and number key events.
keChannelKeys WebTV for Windows passes channel key events to the focus window.

Return Values

Returns an HRESULT indicating success or failure. If the method succeeds it returns S_OK. Otherwise it returns an error code. For specific error code values see Winerror.h.

Remarks

The default behavior is for WebTV for Windows to trap number keys and use them as input to change the channels.

The nKeys flags may be ORed together. For example, the following call to WantKeys causes WebTV for Windows to pass both number keys and PageUp/PageDown keys to the focus window.

WantKeys ( keNumKeys | kePageKeys );
 

Because WantKeys causes WebTV for Windows to send key events to the focus window, a control should ensure that it has focus before it calls this method. Otherwise, the key events will be sent to the focus application, not the control, possibly resulting in unpredictable behavior.

The WebTV for Windows behavior, whether it traps or forwards key events, is set by the most recent call to WantKeys. Furthermore, the key event behavior is set for all controls on the broadcast client. In other words, you cannot cause WebTV for Windows to forward key events to some controls and not others. For example, if control control A calls WantKeys, setting nKeys to keNumKeys, and then control B calls WantKeys, setting nKeys to keNoKeys, WebTV for Windows will use the most recent key event setting, keNoKeys, and neither control will receive key events.

QuickInfo

  Windows NT: Unsupported.
  Windows: Requires Windows 98.
  Windows CE: Unsupported.
  Header: Declared in tvdisp.odl.
  Import Library: Included as a resource in tvx.exe.
  Unicode: Yes.