Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
Q

quay

> 编程语言
Open source

Super simple key binding for JS

99 stars0 likes1 views
WebsiteGitHub

About

Super simple key binding for JS

Quay: Super Simple key binding

Quay is a super simple script that allows you to easily bind key shortcuts to functions using javascript. For instance, say you had this function:

var say_hello = function() {
	alert('Hello there!');
}

You may want that function to run when a key combination is pressed on your page. Just include Quay and add the following:

var q = new Quay(window);

q.capture({
	'ctrl_alt_a':say_hello
});

And voila! Now that function will be run whenever the user presses CTRL+ALT+A on that page. Notice how Quay takes a single argument. This is the element you want to listen for key presses on. In this case a global window will suffice.

Please note: The current key combination (so above would be ctrl_alt_a) is passed as the first argument into the callback (in this case say_hello.) The event that triggered it is also passed in as a second argument

You can also use multiple key combinations for the same callback. For example:

var q = new Quay(window);

q.capture({
    'up,down,left,right': function(key) {
        alert('You pressed the ' + key + ' arrow!');
    }
})

Version

Quay is currently on version: 2.3.2

You can check the version at any time using the Quay.VERSION object. Quay.VERSION.FULL() will return the full version and Quay.VERSION.[MAJOR/MINOR/PATCH] is set to each value respectively.

Quay uses Semantic Versioning

License

Please see LICENSE.md

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言