keycode

[JavaScript] 키보드 이벤트 ( 단축키/hotkey ) 생성하는 방법 ex) `Ctrl + Alt + c` 을 눌렀을 때 이벤트 생성 var isCtrl, isAlt; // ctrl. Alt 눌림 여부 확인 document.onkeyup = function(e) { if (e.which == 17) isCtrl = false; if (e.which == 18) isAlt = false; } document.onkeydown = function(e) { if (e.which == 17) isCtrl = true; if (e.which == 18) isAlt = true; console.log(e.which , isCtrl, isAlt) if (e.which == 67 && isCtrl == tru..
S0PH1A
'keycode' 태그의 글 목록