npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@helios-interactive/okey

v1.1.1

Published

Lightweight and easily customizable onscreen keyboard

Downloads

20

Readme

JS OnScreen Keyboard

What do I use this for

Web apps that need a touchscreen keyboard.

How to use this

var inputs = document.forms["demo"].getElementsByTagName("input");
var keyboardHost = document.querySelector('.keyboard-host');
var keyboard = new window.Keyboard(inputs, keyboardHost);

Check out demo.html for example.

Goals

  • Minimal dependency
  • Works outta the box with vanilla javascript, can be integrated easily to frameworks too
    • Or at least our Backbone apps
  • Has the same behavior click v.s. touch
  • Allows control over its show/hide, create/destroy
  • Allows customization
    • layout
    • style / skin
    • special keys with custom functionalities

Dev Roadmap

  • [x] Generate Keyboard HTML & insert them to a designated element

    • [x] Make it work w/ 3 buttons first
  • [x] Whenever a key is clicked or touched, it would fire an event that keyboard handles

  • [x] Converge all events to a single handler

  • [x] Keyboard can keep track of which element it should update

  • [x] When there is an element the keyboard's focusing on, pressing keys inserts value to it

  • [x] Value inserting works just like actual keyboard, takes caret place and selection into consideration

  • [x] Destroy function to unbind and destroy html

  • [x] Layouts are defined by config json file and can be swapped

  • [x] Keys may insert a different character than its label

  • [ ] Common functionality keys

    • [x] backspace
    • [ ] tab
  • [x] A system to easily attach new func keys

    • [x] 'func' property in layout files used to differentiate b/c keys
    • [x] public function to attach functions to run for keys w/ diff func
    • [x] Keys can have same func but different additional info too, and handlers have access to that
  • [ ] Bug: When input's content is longer than input box's width, it should move the cursor to show the caret

    • Easy way to do this is via setting focusedEl.scrollLeft to a high number. This would however always jump to the end of input no matter where the caret's at.
    • To make this intelligent we need some method of calculating caret's pixel location?
  • [x] Generated keys have a structure that allows easy style changing via CSS

  • [ ] Platform testing

  • [ ] Click, Touch, Chrome's touch simulation, and FastClick.js driven touch event should all behave the same

  • [ ] Getters to make many type checkings easier?

    • [x] setLayout
    • [ ] focusedEl?
    • [ ] keyboardEl?
  • [ ] Support more browsers than just Chrome