Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
MouseEvent.ctrlKey は読み取り専用のプロパティで、このマウスイベントが発生した際に Ctrl キーが押されていたかどうかを示す論理値です。
Macintosh のキーボードでは、このキーは control キーと表記されています。また、 Mac では control キーと組み合わせたクリックは、オペレーティングシステムに拾われてコンテキストメニューを開くのに使われるので、 ctrlKey はクリックイベントで検出されないことに注意してください。
論理値で、 true はキーが押されていたことを示し、 false はキーが押されていなかったことを示します。
この例では、 mousemove イベントを発生させた際に ctrlKey プロパティを記録します。
| Pointer Events # dom-mouseevent-ctrlkey |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2023年11月21日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.