keyboard-layout-map
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

keyboard-layout-map

NPM version

Utils for experimental Web KeyboardLayoutMap API.

Install

npm install keyboard-layout-map

Usage

Get the current keyboard layout.

import { getKeyboardLayout } from 'keyboard-layout-map'

const layout = await getKeyboardLayout()
//     ^: KeyboardLayoutMap | null

Identify the current keyboard layout.

import { identifyKeyboardLayout } from 'keyboard-layout-map'

const name = await identifyKeyboardLayout(layout)
//     ^: "US" | "French" | "German" | "LatinAmerican" ...

Get all supported keyboard layouts (for testing purposes).

import * as layouts from 'keyboard-layout-map/layouts'

const ItalianLayout = layouts['Italian']
//     ^: KeyboardLayoutMap

const SlovakLayout = layouts['Slovak']
//     ^: KeyboardLayoutMap

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i keyboard-layout-map

Weekly Downloads

69

Version

1.1.0

License

MIT

Unpacked Size

23.8 kB

Total Files

9

Last publish

Collaborators

  • ocavue