Files
starface-outlook-sync-addin/node_modules/@fluentui/utilities/lib-amd/keyboard.js
T
Stefan Hacker 37ad745546 first commit
2026-04-03 09:38:48 +02:00

42 lines
1.7 KiB
JavaScript

define(["require", "exports", "./KeyCodes"], function (require, exports, KeyCodes_1) {
"use strict";
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDirectionalKeyCode = isDirectionalKeyCode;
exports.addDirectionalKeyCode = addDirectionalKeyCode;
exports.removeDirectionalKeyCode = removeDirectionalKeyCode;
var DirectionalKeyCodes = (_a = {},
_a[KeyCodes_1.KeyCodes.up] = 1,
_a[KeyCodes_1.KeyCodes.down] = 1,
_a[KeyCodes_1.KeyCodes.left] = 1,
_a[KeyCodes_1.KeyCodes.right] = 1,
_a[KeyCodes_1.KeyCodes.home] = 1,
_a[KeyCodes_1.KeyCodes.end] = 1,
_a[KeyCodes_1.KeyCodes.tab] = 1,
_a[KeyCodes_1.KeyCodes.pageUp] = 1,
_a[KeyCodes_1.KeyCodes.pageDown] = 1,
_a);
/**
* Returns true if the keycode is a directional keyboard key.
*/
function isDirectionalKeyCode(which) {
return !!DirectionalKeyCodes[which];
}
/**
* Adds a keycode to the list of keys that, when pressed, should cause the focus outlines to be visible.
* This can be used to add global shortcut keys that directionally move from section to section within
* an app or between focus trap zones.
*/
function addDirectionalKeyCode(which) {
DirectionalKeyCodes[which] = 1;
}
/**
* Removes a keycode to the list of keys that, when pressed, should cause the focus outlines to be visible.
* This can be used to remove global shortcut keys that directionally move from section to section within
* an app or between focus trap zones.
*/
function removeDirectionalKeyCode(which) {
delete DirectionalKeyCodes[which];
}
});
//# sourceMappingURL=keyboard.js.map