Code Snippet - ctrl + i in javascript

var ctrlKey = false;

		$(document).bind('keydown',function(event){
			if(event.keyCode == 17) {
				ctrlKey = true;
			} 

			if (ctrlKey & event.keyCode == 73) {
				alert('ctrl+i'); 			
			}
		}); 

		$(document).bind('keyup',function(event){
			if(event.keyCode == 17) {
				ctrlKey = false;
			}
		});

相关推荐