UNPKG

expo-key-event

Version:

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

10 lines (8 loc) 278 B
import { KeyCodeMapping } from "../constants/KeyCodeMapping"; export function unifyKeyCode(keyCode: string): string { const res = KeyCodeMapping?.[keyCode]; if (__DEV__ && !res) { console.warn(`No mapping found for keyCode: ${keyCode}`); } return res ?? keyCode; }