@dasilvacontin/keyboard

    1.0.2 • Public • Published

    KeyboardJS

    A simple keyboard utility for the browser.

    const kbd = require('@dasilvacontin/keyboard')
    kbd.debug = true
    
    // any of these work
    if (kbd.isKeyDown(32)) jump()
    if (kbd.isKeyDown(kbd.SPACE_BAR)) jump()
    if (kbd.isKeyDown(' ')) jump()

    Available constants:

    var keyCodes = {
      SPACE_BAR: 32,
    
      LEFT_ARROW: 37,
      UP_ARROW: 38,
      RIGHT_ARROW: 39,
      DOWN_ARROW: 40
    }

    License

    MIT © David da Silva

    Install

    npm i @dasilvacontin/keyboard

    DownloadsWeekly Downloads

    5

    Version

    1.0.2

    License

    MIT

    Last publish

    Collaborators

    • dasilvacontin