1. 개발자를 위한 웹 기술
  2. Web API
  3. KeyboardEvent
  4. KeyboardEvent: ctrlKey property

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

KeyboardEvent: ctrlKey property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015년 7월.

KeyboardEvent.ctrlKey 는 어떤 이벤트가 발생했을 때 키보드의 control 키 가 눌려 있었는지 아닌지 (true) 혹은 (false) 를 나타내는 읽기 전용 속성입니다.

불리언 값입니다.

예제

html
<html lang="en">
 <head>
 <title>ctrlKey example</title>
 <script>
 function showChar(e) {
 alert(`Key Pressed: ${e.key}\nCTRL key pressed: ${e.ctrlKey}\n`);
 }
 </script>
 </head>
 <body onkeypress="showChar(event);">
 <p>
 CTRL 키를 누른 상태에서든 아니든 아무 문자 키를 눌러보세요.<br />
 SHIFT 키 또한 CTRL 키와 함께 사용할 수 있습니다.
 </p>
 </body>
</html>

명세서

Specification
UI Events
# dom-keyboardevent-ctrlkey

브라우저 호환성

같이 보기

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.

AltStyle によって変換されたページ (->オリジナル) /