Coder Social home page Coder Social logo

texlis's Introduction

ah... it's not need, maybe... just use input event alternatively...??? I'll test it for a few days...

texlis.js

text input listener: a javascript library for apps along with text input

description

texlis.js is useful when you want to executing something along with an user text input. On a web browser, to executing some function when a textbox (like <input type="text" />) is editted is a bit difficult, especially under using text input applications (e.g. IME). Some js events (keydown, keypress, keyup) are invoked at all keyboard input, but there are included some needless keyboard input for executing a target function. If you have a page for real-time search result, and there is a text box for input search keyword, a keyboard input "Ctrl-c" is needless to executing the search function, but keydown and keyup events are invoked. Also in IME situation (e.g. input Japanese), some space-key is pushed for hiragana-kanji conversion, but the input text is not confirmed yet: an enter-key confirm it. In this situation, Chrome isn't invoke the keyboard event with enter-key (keyCode = 13): only keydown and keyup event with keyCode = 229 are invoked, while another input like 'a' (Japanese 'ใ‚') invoke keyup event with keyCode of the keyboard pushed additionally. texlis.js listens the keyboard event keydown, keypress and keyup, and callback your function when only useful keys are pushed. Your callback is invoked from a keyup event handler.

how to use

First, include texlis.js in your app. In a html page likes:

<script src="/path/to/directory/texlis.js"></script>

Next, setup texlis with textbox element and callback. A textbox element is like <input type="text" id="textinput" />, and A callback is a function you want to do when keyboard inputs are sent.

new Texlis(document.getElementById('textinput'), (keyupevent) => console.log(keyupevent.keyCode));

texlis's People

Contributors

awazo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.