Skip to content

Instantly share code, notes, and snippets.

@rbao
Created April 8, 2013 15:48
Show Gist options
  • Save rbao/5337850 to your computer and use it in GitHub Desktop.
Save rbao/5337850 to your computer and use it in GitHub Desktop.
$(document).ready(function()
{
var ctrlDown = false;
var ctrlKey = 17, vKey = 86, cKey = 67;
$(document).keydown(function(e)
{
if (e.keyCode == ctrlKey) ctrlDown = true;
}).keyup(function(e)
{
if (e.keyCode == ctrlKey) ctrlDown = false;
});
$(document).keydown(function(e)
{
$("#show").text("Ctrl: " + ctrlDown + " | " + e.keyCode);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment