marquete / kibo Goto Github PK
View Code? Open in Web Editor NEWA simple JavaScript library for handling keyboard events.
A simple JavaScript library for handling keyboard events.
combination keys left+ up,left+down,right+up,right+down are possible?
Firefox has a bfcache which is not used when the page registers an unload
listener. If there is a way to destroy listeners then that would probably be enough, and https://github.com/marquete/kibo/blob/master/kibo.js#L140 could be removed.
Hi! Thanks for the great script!
The only problem I have is that I seem to have to click on the window before any of the keyboard calls will work. Once that happens I'm great, but I feel like I'm missing something simple at the beginning when I setup?
var k = new Kibo();
k.down('esc', function() { close() })
Thanks!
Kibo needs support of the meta
modifier so I can avoid trapping useful keystrokes such as Command-R (reload the page).
Thanks for a useful library!
I've used the qunit before, that is alright and should be enough to most unit tests. Might need something that can simulate pressing keys thou.
Kibo doesn't appear to be hearing me press 'h' on Firefox, when I use window.onkeypress
though that will hear the 'h' press. This also affects other chars like 'v' for example.
The following code
kibo.down([0, 5], function() {
return false;
});
Produces the following error:
Error: string.replace is not a function
Source File: http://localhost:8500/hotspotter/libs/3rdParty/kibo.js
Line: 107
So I think that the keys input for kibo.down
etc should be converted to a string, so that we are certain it is a string. Or there should be some argument validation.
imo a listener should only fire when the exact key(s) requested are pressed, and a listener should not fire when more keys are pressed in combination with the requested key(s).
It's not in the docs but would be really good to have punctuation included.
Right now you can bind keys with modifiers easily:
k.down('ctrl shift q', ...)
It would be awesome if I coud bind keys without modifiers:
k.down('plain q', ...)
I'm not sure if plain
is the right term. unmodified
seems too verbose. :)
After unregistering all the keys
kibo.down('any',null);
kibo.up('any',null);
I get:
kibo.js:181 Uncaught TypeError: Cannot read property 'length' of undefined
I'd like to use Kibo for a project I'll be starting soon, but the fact that its author hasn't seen Django Unchained yet makes me uneasy about its commitment to awesomeness. Would you so kindly care to address this issue?
Many thanks,
Pilaf
We would very much like to use Kibo within our project, but we are unable to because there is no copyright message anywhere in either the js source file or the readme.
Our open source police are quite stringent!
Please could the author add a copyright.
Regards,
Stuart
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.