WinJS.UI.XYFocus.keyCodeMap property

Gets or sets an object that specifies the key codes used to move between focusable HTML elements.
Syntax
var keyCodeMap = WinJS.UI.XYFocus.keyCodeMap;
WinJS.UI.XYFocus.keyCodeMap = keyCodeMap;
Property value
Type:
An object with this structure:
| Property | Description |
|---|---|
|
Array An array of Number objects that specify the key codes that move focus in the up direction. | |
|
Array An array of Number objects that specify the key codes that move focus in the left direction. | |
|
Array An array of Number objects that specify the key codes that move focus in the down direction. | |
|
Array An array of Number objects that specify the key codes that move focus in the right direction. |
Remarks
XYFocus automatically maps by default to the arrow keys on the keyboard. This mapping can be changed using keyCodeMap as shown in the example below.
Examples
This example enables the user to navigate with the w, s, a, and d keys in addition to the default mappings.
WinJS.UI.XYFocus.keyCodeMap.up.push(WinJS.Utilities.Key.w); WinJS.UI.XYFocus.keyCodeMap.down.push(WinJS.Utilities.Key.s); WinJS.UI.XYFocus.keyCodeMap.left.push(WinJS.Utilities.Key.a); WinJS.UI.XYFocus.keyCodeMap.right.push(WinJS.Utilities.Key.d);
Requirements
|
Minimum WinJS version |
WinJS 3.0 |
|---|---|
|
Namespace |
WinJS.UI.XYFocus |
See also