import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import*as React from"react";import{Keys,pressedKey}from"../lib/accessibility";import{useDOM}from"../lib/dom";import{useGlobalEventListener}from"./useGlobalEventListener";function useKeyboardInputTracker(){var e=useDOM().document,r=React.useState(!1),t=_slicedToArray(r,2),s=t[0],o=t[1],a=React.useCallback(function(e){pressedKey(e)===Keys.TAB&&o(!0)},[]),r=React.useCallback(function(){o(!1)},[]),t={passive:!0,capture:!0};return useGlobalEventListener(e,"keydown",a,t),useGlobalEventListener(e,"mousedown",r,t),useGlobalEventListener(e,"touchstart",r,t),s}export{useKeyboardInputTracker};