/*---------------------------------------------------------------------------------------------
* 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
 */
import * as React from "react";
import { SpecialKey } from "@itwin/appui-abstract";
import { UiFramework } from "../UiFramework";
/** Keyboard Event handler to set focus to Home on Escape key
 * @internal
 */
export function onEscapeSetFocusToHome(e) {
    // istanbul ignore else
    if (e.key === SpecialKey.Escape) {
        UiFramework.keyboardShortcuts.setFocusToHome();
    }
}
/** useCallback Hook for Keyboard Event handler to set focus to Home on Escape key
 * @internal
 */
export function useEscapeSetFocusToHome() {
    return React.useCallback(onEscapeSetFocusToHome, []);
}
//# sourceMappingURL=useEscapeSetFocusToHome.js.map