Understanding Mouse, Keyboard, and Remote Control Input
Users can navigate Windows Media Center using any of the following:
- Mouse
- Keyboard
- Remote control
For mouse control, users can hover over and select items within Windows Media Center (and a well-designed application will account for this model at all times). When a mouse is used to navigate, Windows Media Center displays navigation and transport controls that overlay the current experience to help users control their experience when using a mouse, as shown in the following figure:
.jpg)
Users can navigate the Windows Media Center UI using keyboard navigation. See Keyboard Shortcuts for a list of keyboard shortcuts.
Windows Media Center also accepts user input from anywhere in the room through a remote control device. This device looks like a standard remote control for a television or other home entertainment device and has buttons for several specialized Windows Media Center functions. The following figure shows a remote control designed for use with a Windows Media Center PC. The appearance of the remote control may vary from manufacturer to manufacturer. However, the core functionality is constant.
.jpg)
The remote control interacts with an infrared sensor, which consists of the following hardware:
- A receiver component that processes input from the remote control
- A circuit for learning infrared commands
- A universal serial bus (USB) connection that sends input notifications to software running on the computer
- Two emitter ports
In addition, the sensor requires a device driver that supports the Plug and Play specification. A default driver is installed with the versions of the Microsoft Windows operating system that support the infrared sensor.
The USB cable enables users to place the sensor near the monitor so they can point the remote at the monitor when sending commands to the computer. Alternatively, the sensor might be mounted in the front panel of the computer by the manufacturer.
Input from the remote control is processed as follows:
- The sensor receives the signal and forwards it to a device driver on the computer.
- The device driver converts the input into a WM_INPUT, WM_APPCOMMAND, WM_KEYDOWN, WM_KEYPRESS, or WM_KEYUP message.
- Windows places these messages in the message queue to be processed by a program's main window procedure.
- The foreground program processes messages of interest. For example, a digital media streaming program could process the messages corresponding to the transport buttons (Pause, Play, Stop, Fast Forward, and Rewind) but ignore messages from the numeric keypad.
Trapping Events
Applications can trap certain mouse, keyboard, and remote control events. How you trap remote control button presses depends on the application's implementation.
For Windows Media Center Presentation Layer applications, you can trap remote control button presses using either the ShortcutHandler or KeyHandler element in Windows Media Center Markup Language (MCML).
For hosted HTML applications, the remote control buttons trigger the MediaCenter.onRemoteEvent event using a virtual key (VK) code. For a list of the buttons that send a VK code, see MediaCenter.onRemoteEvent.
Hosted HTML has specific handlers for the following keyboard commands:
- Keyboard - Back
- Keyboard - BrowserBack
- Keyboard - Down
- Keyboard - Left
- Keyboard - MediaNextTrack
- Keyboard - MediaPlayPause
- Keyboard - MediaPreviousTrack
- Keyboard - MediaStop
- Keyboard - Pause
- Keyboard - Play
- Keyboard - Right
- Keyboard - Tab
For more information, see the following topics:
See Also