Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

The toggle keys option provides sound feedback when the user turns on or off the CAPS LOCK, NUM LOCK, or SCROLL LOCK key. When the toggle keys option is on, the Windows Embedded CE-based device emits a high-pitched sound whenever the user turns on the CAPS LOCK, NUM LOCK, or SCROLL LOCK key and emits a low-pitched sound whenever the user turns off one of these keys.

The user can control the settings for the toggle keys option by using the Keyboardtab of the AccessibilityControl Panel application or another application for customizing the environment.

Applications use the SPI_GETTOGGLEKEYS and SPI_SETTOGGLEKEYS flags with the SystemParametersInfofunction to get and set the toggle keys option. The TOGGLEKEYSstructure defines the parameters for the toggle keys option. To set the toggle keys option, call SystemParametersInfowith the uiActionparameter set to SPI_SETTOGGLEKEYS, the uiParamparameter set to the size of the TOGGLEKEYSstructure, and the pvParamparameter set to a pointer to a TOGGLEKEYSstructure that contains the toggle keys parameters that you want to use. You should set the TKF_TOGGLEKEYSON flag in the dwFlagsmember of the TOGGLEKEYSstructure that you pass to SystemParametersInfo.

The following code example shows how to enable the toggle keys option.

Copy Code
TOGGLEKEYS tkf;
BOOL bSuccess;

// Fill in the members of the TOGGLEKEYS structure.

tkf.cbSize = sizeof(TOGGLEKEYS);
tkf.dwFlags = (TKF_AVAILABLE | TKF_TOGGLEKEYSON);

// Call SystemParametersInfo with the SPI_SETTOGGLEKEYS flag. 

bSuccess = SystemParametersInfo(SPI_SETTOGGLEKEYS,
sizeof(TOGGLEKEYS), 
								(LPVOID) &tkf, 0); 

To retrieve information about the toggle keys option, call SystemParametersInfowith uiActionset to SPI_GETTOGGLEKEYS, uiParamset to the size of the TOGGLEKEYSstructure, and pvParamset to a pointer to a TOGGLEKEYSstructure. Examine the values of the members of the TOGGLEKEYSstructure after SystemParametersInforeturns to obtain the information that you want about the toggle keys option.

See Also