macos-accessibility-keyboard
v1.0.1
Published
The missing interface for the hidden native virtual on-screen keyboard on macOS.
Downloads
8
Maintainers
Readme
macos-accessibility-keyboard
Contents
Usage
Installation
$ npm install macos-accessibility-keyboard --save
CommonJS Require
const keyboard = require('macos-accessibility-keyboard')
ES6 Module Import
import keyboard from 'macos-accessibility-keyboard'
API
This module exposes the following methods:
isEnabled()
- Returns:
Promise<Boolean>
- Check whether the accessibility on-screen keyboard is enabled
isEnabledSync()
- Returns:
Boolean
- Check whether the accessibility on-screen keyboard is enabled, synchronously
enable()
- Returns:
Promise
- Enables the keyboard
disable()
- Returns:
Promise
- Disables the keyboard
toggle()
- Returns:
Promise
- Toggles the keyboard
Examples
Show
const {enable, disable} = require('macos-accessibility-keyboard');
enable().then(() => {
console.log('The keyboard was enabled.')
disable().then(() => {
console.log('The keyboard was disabled.')
})
})
>>> The keyboard was enabled.
Check
const keyboard = require('macos-accessibility-keyboard');
const isEnabled = keyboard.isEnabledSync()
console.log('The keyboard is:', isEnabled ? 'on': 'off')
>>> The keyboard is: off
Platforms
Tested on macOS High Sierra 10.13.4.
Contribututions
Read the contribution documentation first.
Author
sidneys.github.io 2018