ssbc/keyboard-layout-prebuilt

Name: keyboard-layout-prebuilt

Owner: Secure Scuttlebutt Consortium

Description: Fork of keyboard-layout that adds automated prebuilds

Forked from: atom/keyboard-layout

Created: 2017-12-11 04:54:00.0

Updated: 2017-12-11 05:12:54.0

Pushed: 2017-12-11 05:27:13.0

Homepage:

Size: 110

Language: C++

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

keyboard-layout

macOS Build Status Windows Build status Dependency Status

Read and observe the current keyboard layout.

To get the current keyboard layout, call getCurrentKeyboardLayout. It returns the string identifier of the current layout based on the value returned by the operating system.

t KeyboardLayout = require('keyboard-layout')
oardLayout.getCurrentKeyboardLayout() // => "com.apple.keylayout.Dvorak"

If you want to watch for layout changes, use onDidChangeCurrentKeyboardLayout or observeCurrentKeyboardLayout. They work the same, except observeCurrentKeyboardLayout invokes the given callback immediately with the current layout value and then again next time it changes, whereas onDidChangeCurrentKeyboardLayout only invokes the callback on the next change.

t KeyboardLayout = require('keyboard-layout')
cription = KeyboardLayout.observeCurrentKeyboardLayout((layout) => console.log(layout))
cription.dispose() // to unsubscribe later

To return characters for various modifier states based on a DOM 3 KeyboardEvent.code value and the current system keyboard layout, use getCurrentKeymap():

t KeyboardLayout = require('keyboard-layout')
oardLayout.getCurrentKeymap()['KeyS']

 US layout, this returns:

modified: 's',
thShift: 'S',
thAltGraph: 'ß',
thShiftAltGraph: 'Í'



This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.