Integration with hardware buttons (hot keys)

Windows supports two main mechanisms for changing brightness through keyboard shortcuts (hot keys): Human Interface Device (HID), and Advanced Configuration and Power Interface (ACPI) notifications.

HID-based brightness hot keys

A large percentage of keyboards on System on a Chip (SoC)-based portable laptop use HID over I²C (or over Universal Serial Bus (USB)) to communicate with the host. Windows 8 has added new support and standardized a solution for keyboards (external or embedded) to control the display brightness on a laptop or slate by using HID. Using HID is the preferred solution for implementing hot keys: it reduces the need for an embedded controller on the main board of a Windows PC, resulting in reduced system manufacturing costs and power consumption. In addition, using HID obviates the need for system developers to implement auto-repeat when a hot key is pressed and held.

Windows 8 ships with a HID class driver, as well as the corresponding HID I²C and HID USB miniport drivers. Therefore, device vendors who adhere to the HID protocol are not required to implement any of these drivers. Instead, HID-compliant keyboards are only required to report a set of usages in their device firmware. Windows will use the usages reported by the device firmware and its own drivers to parse and act on the keyboard reports that are generated as a result of user keystrokes.

To support brightness change through hot keys, PC manufacturers should use the HID usages that are listed in Table 1 HID - Usages on consumer controls page supported in Windows 8, as part of their consumer controls collection. Each hot key button press results in an increase or decrease in the display brightness level policy value (see Table 1 Display brightness setting in Display brightness) by at least 10 percent until the next available 10 percent increment is reached (for example, 10, 20, 30, ..., 90, 100). In addition, Windows 8 implements continuous brightness increase or decrease when either of the brightness up or down buttons are pressed and held down. More specifically, Windows internally implements an auto-repeat functionality when those buttons are pressed and held down. Therefore, the firmware in the keyboard controller should not attempt to implement auto-repeat.

Table 1 HID - Usages on consumer controls page supported in Windows 8

Usage ID Usage name Usage type
0x006F Brightness Increment Re-trigger Control (RTC)
0x0070 Brightness Decrement Re-trigger Control (RTC)

 

For additional details on keyboard implementation in Windows 8 and HID, see Keyboard Enhancements in Windows 8.

ACPI-based brightness hot keys

Brightness control hot keys on the keyboard can also be implemented by using ACPI notifications. These notifications are targeted to the integrated display device, not to the graphics adapter. Windows supports the following ACPI notifications for keyboard hot key implementations:

#define ACPI_NOTIFY_CYCLE_BRIGHTNESS_HOTKEY 0x85
#define ACPI_NOTIFY_INC_BRIGHTNESS_HOTKEY   0x86
#define ACPI_NOTIFY_DEC_BRIGHTNESS_HOTKEY   0x87
#define ACPI_NOTIFY_ZERO_BRIGHTNESS_HOTKEY  0x88

These notifications are described in the Advanced Configuration and Power Interface Specification, version 3.0 and later.

Typically, an implementation does not support all four of these notifications. The commonly supported notifications include ACPI_NOTIFY_INC_BRIGHTNESS_HOTKEY and APCI_NOTIFY_DEC_BRIGHTNESS_HOTKEY. Similar to HID-based implementation, each hot key button press results in an increase or decrease the display brightness level policy value (see Table 1 Display brightness setting in Display brightness) by at least 10 percent until the next available 10 percent increment is reached (for example, 10, 20, 30, ..., 90, 100).

To implement continuous brightness increase or decrease when either of the brightness up or down buttons are pressed and held down, the system should repeatedly send the corresponding ACPI notifications. The first repeated notification should be sent 500 ms after a button is pressed and held. The repeat rate should be such that there is a total end-to-end delay of 2.5 seconds to reach from 0 to 100 (or vice versa).

 

 

Send comments about this topic to Microsoft