Interface implementation guidance

This section provides guidance for interface implementation.

In this section

Topic Description

Available interfaces and related APIs

There are three GPIO interfaces: one for each device. Each interface is referenced by a GUID.

Indicator implementation

This topic describes indicator implementation.

Button implementation

We recommend that you use a physical GPIO resource for both the buttons and state indicators.

System state

The default state for all buttons that are supported by the inbox driver on load is in the UP position.

The first indication by using the interface toggled the specified button (by index) to a state of DOWN.

The default state of the laptop/slate mode indicator is SLATE.

The default state of the docked mode indicator is UNDOCKED.

The first indication by using the interface toggled the indicator to the other state.

To query the state, you can use the GetSystemMetric API as follows:

int WINAPI GetSystemMetrics(
  _In_  int nIndex
);

Parameters that are available for indicators:

  • SM_SYSTEMDOCKED for the docking state. The call returns 0 for Undocked Mode and non-zero otherwise.
  • SM_CONVERTIBLESLATEMODE for the slate mode. The call returns 0 for Slate Mode and non-zero otherwise.

Notifications

When either system metric SM_CONVERTIBLESLATEMODE or SM_SYSTEMDOCKED changes, a broadcast message is sent by the system by using WM_SETTINGCHANGE.

The LPARAM of the WM_SETTINGCHANGE message indicates which system metric has changed by using a string of either “ConvertibleSlateMode” or “SystemDockMode”.