"use strict";
/*---------------------------------------------------------------------------------------------
 * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
 * See LICENSE.md in the project root for license terms and full copyright notice.
 *--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Hooks
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.useEscapeSetFocusToHome = exports.onEscapeSetFocusToHome = void 0;
const React = require("react");
const ts_key_enum_1 = require("ts-key-enum");
const UiFramework_1 = require("../UiFramework");
/** Keyboard Event handler to set focus to Home on Escape key
 * @internal
 */
function onEscapeSetFocusToHome(e) {
    if (e.key === ts_key_enum_1.Key.Escape.valueOf()) {
        UiFramework_1.UiFramework.keyboardShortcuts.setFocusToHome();
    }
}
exports.onEscapeSetFocusToHome = onEscapeSetFocusToHome;
/** useCallback Hook for Keyboard Event handler to set focus to Home on Escape key
 * @internal
 */
function useEscapeSetFocusToHome() {
    return React.useCallback(onEscapeSetFocusToHome, []);
}
exports.useEscapeSetFocusToHome = useEscapeSetFocusToHome;
//# sourceMappingURL=useEscapeSetFocusToHome.js.map