{"_id":"k-component","_rev":"16-25e82c58865f9d9d3269341646a8220c","name":"k-component","description":"keyboard event dispatcher","dist-tags":{"latest":"0.6.2"},"versions":{"0.4.0":{"name":"k-component","description":"keyboard event dispatcher","author":{"name":"Amir Abu Shareb","email":"yields@icloud.com"},"version":"0.4.0","main":"index.js","dependencies":{"keycode-component":"*","event-component":"*","bind-component":"*","os-component":"*"},"browser":{"keycode":"keycode-component","event":"event-component","bind":"bind-component","os":"os-component"},"component":{"scripts":{"k/index.js":"index.js","k/proto.js":"proto.js"}},"_id":"k-component@0.4.0","dist":{"shasum":"44b61c6c358c2904aa6405ede69ae9a1b7434d71","tarball":"https://registry.npmjs.org/k-component/-/k-component-0.4.0.tgz","integrity":"sha512-W2QxO1rzg/7/YbluvO5vLDprPwWAXBhg4DEf69LgSShJovll92/NdFYHY+4+VaLhQ7nL1BJi5Dk8SKB2+1N/8g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGq0Z7acC0QeNwVujVwW7KTVXhm6zRI7rTW/bvzWY/1eAiBhctB6HwcyXRR+zUz416oPow8EXCVUv86gMq/+QC2FxA=="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"yields","email":"yields@icloud.com"},"maintainers":[{"name":"yields","email":"yields@icloud.com"}]},"0.6.2":{"name":"k-component","description":"keyboard event dispatcher","author":{"name":"Amir Abu Shareb","email":"yields@icloud.com"},"version":"0.6.2","main":"index.js","dependencies":{"keycode-component":"*","event-component":"*","bind-component":"*","os-component":"*"},"browser":{"keycode":"keycode-component","event":"event-component","bind":"bind-component","os":"os-component"},"component":{"scripts":{"k/index.js":"index.js","k/proto.js":"proto.js"}},"_id":"k-component@0.6.2","dist":{"shasum":"98296867d03580f0bb46743af98c98c4f1fc049e","tarball":"https://registry.npmjs.org/k-component/-/k-component-0.6.2.tgz","integrity":"sha512-rML9/TG1qeWuQOU8xoDVSnQ52VDxJj111kcccB1sMbr+VRh45J4Xm5RUq8fbkIInuzekSciBuNiGBDSRsm3Hew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCf4NJUU/Xdr1J7xhSu8rzSRzjRCCnSlR/qB3UXDVejfgIhAOVSsJHtXnr31tf17Sr60lFBJT+owaQU9GivZjYhxzzC"}]},"_from":".","_npmVersion":"1.3.15","_npmUser":{"name":"yields","email":"yields@icloud.com"},"maintainers":[{"name":"yields","email":"yields@icloud.com"}]}},"readme":"# k\n\n  keyboard event dispatcher.\n\n## Installation\n\n    $ component install yields/k\n\n## Features\n\n  - `super` keyword is `command` on mac and `ctrl` on anything else.\n  - gmail like sequences `(a b c *)`\n  - key combos\n  - nice simple api\n  - you can unbind anything you bind\n\n## Example\n\n```js\nvar k = require('k')(window);\n\n// combos\nk('command + shift + enter', fn);\n\n// on OSX `super` will be replaced with `command`\n// on other operating systems it will be replaced with `ctrl`.\nk('super + k', fn);\n\n// sequences\nk('a b c', fn);\nk('* b c', fn);\nk('super + shift + a b c', fn);\n```\n\n## API\n\n### k(el)\n\n  Create a new keyboard dispatcher on the given `element`\n\n### k(keys, fn)\n\n  Bind the given `fn` on `keys`.\n\n### .el\n\n  the element `k` is listening on.\n\n### #bind\n\n  Bind `keys` with `fn(e)`.\n\n### #unbind\n\n  Unbind all listeners of `keys`,\n  unbind `fn` with `keys`,\n  unbind all listeners on all keys.\n\n```js\nk.unbind(); // => unbind all listeners\nk.unbind('enter'); // => unbind all enter listeners\nk.unbind('command + enter'); // => unbind all `command + enter` listeners\nk.unbind('command + enter', fn); // => unbind `fn` just from `command + enter`\n```\n\n### #destroy\n\n  Removes all listeners on `k.el`.\n  Removes all `k.listeners`.\n\n### #ignore\n\n  this function is called just before any handlers are called,\n  if it returns `true` no handlers will be called for this event.\n\n  by default it returns `true` for `input`, `textarea` or `select`.\n\n  if you still want `k` to handle `inputs` you can `k.ignore = false`.\n\n### .shift\n\n  `true` if `shiftKey` is down.\n\n### .ctrl\n\n  `true` if `ctrlKey` is down.\n\n### .alt\n\n  `true` if `alt` is down.\n\n### .command\n\n  `true` if `command` is down.\n\n### .modifiers\n\n  `null` if no modifiers are down, otherwise it's `true`.\n\n### .super\n\n  `true` if `command` or `ctrl` are down (osx / others)\n\n## Tests\n\n```bash\n$ make test\n```\n\n## License\n\n  MIT\n","maintainers":[{"name":"yields","email":"yields@icloud.com"}],"time":{"modified":"2022-06-19T07:37:36.437Z","created":"2013-09-16T14:41:20.544Z","0.4.0":"2013-09-16T14:41:28.124Z","0.6.2":"2014-05-20T04:01:09.569Z"},"author":{"name":"Amir Abu Shareb","email":"yields@icloud.com"},"users":{"parroit":true,"alexcabrera":true},"readmeFilename":"Readme.md"}