"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 appui_abstract_1 = require("@itwin/appui-abstract");
const UiFramework_1 = require("../UiFramework");
/** Keyboard Event handler to set focus to Home on Escape key
 * @internal
 */
function onEscapeSetFocusToHome(e) {
    // istanbul ignore else
    if (e.key === appui_abstract_1.SpecialKey.Escape) {
        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