Created
January 6, 2017 11:32
-
-
Save anonymous/f336b25058855e436d0f5b7df22850df to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/xajipev
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<script src="http://cdn.rawgit.com/dmauro/Keypress/master/keypress.js"></script> | |
<script src="https://code.jquery.com/jquery-3.1.0.js"></script> | |
</head> | |
<body> | |
<p>Check out console to see log</p> | |
<button class="register-meta-combo"> | |
REGISTER META COMBO | |
</button> | |
<button class="register-ctrl-combo"> | |
REGISTER CTRL COMBO | |
</button> | |
<hr> | |
<button class="unregister-meta-combo"> | |
UNREGISTER META COMBO | |
</button> | |
<button class="unregister-ctrl-combo"> | |
UNREGISTER CTRL COMBO | |
</button> | |
<script id="jsbin-javascript"> | |
this.listener = new window.keypress.Listener(); | |
$('.register-meta-combo').click(() => { | |
console.log('register-meta-combo - meta c'); | |
this.listener.register_combo({ | |
keys: "meta c", | |
is_solitary: true, | |
on_keydown: () => { | |
console.log('meta c pressed'); | |
}, | |
}); | |
}) | |
$('.register-ctrl-combo').click(() => { | |
console.log('register-ctrl-combo - ctrl v'); | |
this.listener.register_combo({ | |
keys: "ctrl v", | |
is_solitary: true, | |
on_keydown: () => { | |
console.log('ctrl v pressed'); | |
}, | |
}); | |
}) | |
$('.unregister-meta-combo').click(() => { | |
console.log('unregister-meta-combo - meta c'); | |
this.listener.unregister_combo('meta c'); | |
}) | |
$('.unregister-ctrl-combo').click(() => { | |
console.log('unregister-ctrl-combo - ctrl v'); | |
this.listener.unregister_combo('ctrl v'); | |
}) | |
</script> | |
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<script src="//cdn.rawgit.com/dmauro/Keypress/master/keypress.js"><\/script> | |
<script src="https://code.jquery.com/jquery-3.1.0.js"><\/script> | |
</head> | |
<body> | |
<p>Check out console to see log</p> | |
<button class="register-meta-combo"> | |
REGISTER META COMBO | |
</button> | |
<button class="register-ctrl-combo"> | |
REGISTER CTRL COMBO | |
</button> | |
<hr> | |
<button class="unregister-meta-combo"> | |
UNREGISTER META COMBO | |
</button> | |
<button class="unregister-ctrl-combo"> | |
UNREGISTER CTRL COMBO | |
</button> | |
</body> | |
</html></script> | |
<script id="jsbin-source-javascript" type="text/javascript">this.listener = new window.keypress.Listener(); | |
$('.register-meta-combo').click(() => { | |
console.log('register-meta-combo - meta c'); | |
this.listener.register_combo({ | |
keys: "meta c", | |
is_solitary: true, | |
on_keydown: () => { | |
console.log('meta c pressed'); | |
}, | |
}); | |
}) | |
$('.register-ctrl-combo').click(() => { | |
console.log('register-ctrl-combo - ctrl v'); | |
this.listener.register_combo({ | |
keys: "ctrl v", | |
is_solitary: true, | |
on_keydown: () => { | |
console.log('ctrl v pressed'); | |
}, | |
}); | |
}) | |
$('.unregister-meta-combo').click(() => { | |
console.log('unregister-meta-combo - meta c'); | |
this.listener.unregister_combo('meta c'); | |
}) | |
$('.unregister-ctrl-combo').click(() => { | |
console.log('unregister-ctrl-combo - ctrl v'); | |
this.listener.unregister_combo('ctrl v'); | |
})</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.listener = new window.keypress.Listener(); | |
$('.register-meta-combo').click(() => { | |
console.log('register-meta-combo - meta c'); | |
this.listener.register_combo({ | |
keys: "meta c", | |
is_solitary: true, | |
on_keydown: () => { | |
console.log('meta c pressed'); | |
}, | |
}); | |
}) | |
$('.register-ctrl-combo').click(() => { | |
console.log('register-ctrl-combo - ctrl v'); | |
this.listener.register_combo({ | |
keys: "ctrl v", | |
is_solitary: true, | |
on_keydown: () => { | |
console.log('ctrl v pressed'); | |
}, | |
}); | |
}) | |
$('.unregister-meta-combo').click(() => { | |
console.log('unregister-meta-combo - meta c'); | |
this.listener.unregister_combo('meta c'); | |
}) | |
$('.unregister-ctrl-combo').click(() => { | |
console.log('unregister-ctrl-combo - ctrl v'); | |
this.listener.unregister_combo('ctrl v'); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment