UNPKG

expo-key-event

Version:

Provides an interface for reading key events such as from external bluetooth keyboards on Android, iOS and Web.

20 lines 836 B
import { KeyPressEvent } from "../ExpoKeyEvent.types"; /** * This hook is used to listen for key events, but it doesn't keep the track of it. * This is useful if you want to handle the state yourself or use the event outside of the react lifecycle. * @param listenOnMount Pass 'false' to prevent automatic key event listening * - Use startListening/stopListening to control the listener manually * @param preventReload Prevent reloading the app when pressing 'r' * */ export declare function useKeyEventListener(listener: (event: KeyPressEvent) => void, listenOnMount?: boolean, preventReload?: boolean): { /** * Start listening for key events */ startListening: () => void; /** * Stop listening for key events */ stopListening: () => void; }; //# sourceMappingURL=useKeyEventListener.d.ts.map