aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/mouseevent/ctrlkey/index.md
diff options
context:
space:
mode:
Diffstat (limited to 'files/ja/web/api/mouseevent/ctrlkey/index.md')
-rw-r--r--files/ja/web/api/mouseevent/ctrlkey/index.md75
1 files changed, 75 insertions, 0 deletions
diff --git a/files/ja/web/api/mouseevent/ctrlkey/index.md b/files/ja/web/api/mouseevent/ctrlkey/index.md
new file mode 100644
index 0000000000..920a4cae65
--- /dev/null
+++ b/files/ja/web/api/mouseevent/ctrlkey/index.md
@@ -0,0 +1,75 @@
+---
+title: MouseEvent.ctrlKey
+slug: Web/API/MouseEvent/ctrlKey
+translation_of: Web/API/MouseEvent/ctrlKey
+---
+<p>{{APIRef("DOM Events")}}</p>
+
+<p>読み取り専用プロパティ <strong><code>MouseEvent.ctrlKey</code></strong> は、イベント発生時に <kbd>control</kbd> キーが押されたかどうかを、押されていた (<code>true</code>) または押されていない (<code>false</code>) の{{jsxref("Boolean")}} で返します。</p>
+
+<h2 id="構文">構文</h2>
+
+<pre class="syntaxbox">var <em>ctrlKeyPressed</em> = <em>instanceOfMouseEvent</em>.ctrlKey
+</pre>
+
+<h3 id="戻り値">戻り値</h3>
+
+<p>A boolean</p>
+
+<h2 id="Example" name="Example">例</h2>
+
+<pre class="brush: js">&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;ctrlKey使用例&lt;/title&gt;
+
+&lt;script type="text/javascript"&gt;
+
+function showChar(e){
+ alert(
+ "Key Pressed: " + String.fromCharCode(e.charCode) + "\n"
+ + "charCode: " + e.charCode + "\n"
+ + "CTRL key pressed: " + e.ctrlKey + "\n"
+ );
+}
+
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onkeypress="showChar(event);"&gt;
+&lt;p&gt;何か文字キーを単体またはCTRLキーと同時に押してください。&lt;br /&gt;
+また、CTRLキーに加え、SHIFTキーも同時に使用できます。&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
+</pre>
+
+<h2 id="仕様">仕様</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM3 Events','#widl-MouseEvent-ctrlKey','MouseEvent.ctrlKey')}}</td>
+ <td>{{Spec2('DOM3 Events')}}</td>
+ <td>{{SpecName('DOM2 Events')}}から変更なし</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM2 Events','#Events-MouseEvent','MouseEvent.ctrlKey')}}</td>
+ <td>{{Spec2('DOM2 Events')}}</td>
+ <td>最初期の定義</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザ互換性</h2>
+
+<p>{{Compat("api.MouseEvent.ctrlKey")}}</p>
+
+<h2 id="See_also" name="See_also">関連情報</h2>
+
+<ul>
+ <li>{{ domxref("MouseEvent") }}</li>
+</ul>