diff options
Diffstat (limited to 'files/zh-cn/web/api/uievent/ischar')
-rw-r--r-- | files/zh-cn/web/api/uievent/ischar/index.html | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/uievent/ischar/index.html b/files/zh-cn/web/api/uievent/ischar/index.html new file mode 100644 index 0000000000..8d6097d123 --- /dev/null +++ b/files/zh-cn/web/api/uievent/ischar/index.html @@ -0,0 +1,23 @@ +--- +title: event.isChar +slug: Web/API/UIEvent/isChar +translation_of: Web/API/UIEvent/isChar +--- +<p>{{ ApiRef() }}</p> +<div class="warning"> + <strong>警告:</strong> 不要使用该属性,该属性有一个已知的bug,就是它始终返回<code>false</code>,从不返回<code>true</code>.查看<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=312552" title="https://bugzilla.mozilla.org/show_bug.cgi?id=312552">https://bugzilla.mozilla.org/show_bug.cgi?id=312552</a></div> +<h3 id="Summary" name="Summary">概述</h3> +<p>返回一个布尔值,表明该事件是否是由一个字符按键触发的.</p> +<h3 id="Syntax" name="Syntax">语法</h3> +<pre class="eval">bool = event.isChar +</pre> +<h3 id="Example" name="Example">例子</h3> +<pre> if(e.isChar){ + echoInput(e.type); + } +</pre> +<h3 id="Notes" name="Notes">备注</h3> +<p>一些常用的组合键可能会触发键盘事件,但是不会产生任何字符(例如:CTRL + ALT + ?).在这种情况下,isChar返回false.isChar常用于判断用户在一个文本输入框内输入的是否为一个字符.</p> +<h3 id="Specification" name="Specification">规范</h3> +<p>不属于任何公开的规范</p> +<p>{{ languages( {"pl": "pl/DOM/event.isChar","en": "en/DOM/event.isChar" } ) }}</p> |