Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

keyboard-event-key-type

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keyboard-event-key-type

Contains strings literals for the keyboard event keys

  • 1.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Keyboard Event Key Types

Description

A simple Typescript package that contains the types of the keyboard-event-key as string-literals like: ArrowDown, ArrowUp and so on.

Getting Started

Installing

npm install --save keyboard-event-key-type

Usage

document.addEventListener('keydown', function ( event ) {
    const actualKey = <KeyboardEventKey>event.key
    const actionKey : KeyboardEventKey = "ArrowDown" // <- intellisense
    if (actualKey === actionKey) {
        // clicked !
    }
})
IntelliSense

The package mainly helps with the IDE-IntelliSense: Alt text

Supported types

All keys are taken from developer.mozilla.KeyboardEvent.Keys as of 11/19/2021, with additional support to custom keys.

  • NumericKeypadKeys
  • UpperAlpha
  • LowerAlpha
  • ModifierKeys
  • WhitespaceKeys
  • NavigationKeys
  • EditingKeys
  • UIKeys
  • DeviceKeys
  • IMECompositionKeys
  • LinuxDeadKeys
  • FunctionKeys
  • PhoneKeys
  • MultimediaKeys
  • TVControlKeys
  • MediaControllerKeys
  • SpeechRecognitionKeys
  • DocumentKeys
  • ApplicationSelectorKeys
  • BrowserControlKeys
  • KoreanKeyboardsOnly
  • DeprecatedWhitespaceKey
  • SpecialValueKey
  • CustomValueKey

Keywords

FAQs

Package last updated on 19 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc