html5 中的快捷键(Alt+s 或 Alt+w 等)



如何为快捷键HTML5编写代码,如下面的图像链接。

http://screencast.com/t/iHOJqwy9

似乎是一个重复的问题,但很少有可能的解决方案是:

如何使用JavaScript检测Ctrl + V,Ctrl + C?

$(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;
});
$(".no-copy-paste").keydown(function(e)
{
    if (ctrlDown && (e.keyCode == vKey || e.keyCode == cKey)) return false;
});

});


$(document).bind('keydown', 'ctrl+c', function(event){   
$.fancybox.close(); // if this is commented out, CTRL-C works just fine
return true;

});


$(document).keydown(function(e) {
if (e.keyCode == 67 && e.ctrlKey) {
    /* do your stuff */
    $("#test").text("copied!"); /* optional */
}

});

jquery 热键和 CTRL-C

最新更新