--- title: KeyboardEvent.isComposing slug: Web/API/KeyboardEvent/isComposing tags: - API - DOM - KeyboardEvent - events - 键盘事件 translation_of: Web/API/KeyboardEvent/isComposing ---

{{APIRef("DOM Events")}}

KeyboardEvent.isComposing 只读属性,返回一个 {{jsxref("Boolean")}} 值,表示该事件是否在 {{event("compositionstart")}} 之后和 {{event("compositionend")}} 之前被触发。

语法

var bool = event.isComposing;

示例

var kbdEvent = new KeyboardEvent("syntheticKey", false);
console.log(kbdEvent.isComposing); // return false

标准

Specification Status Comment
{{SpecName('DOM3 Events','#widl-KeyboardEvent-isComposing','KeyboardEvent.isComposing')}} {{Spec2('DOM3 Events')}} Initial definition.

浏览器兼容性

{{ CompatibilityTable() }}

特性 Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
基本支持 {{ CompatChrome(56.0) }} {{ CompatGeckoDesktop("31.0") }} {{ CompatNo() }} {{ CompatOpera(43) }} {{ CompatNo() }}
特性 Android Webview Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile Chrome for Android
基本支持 {{ CompatChrome(56.0) }} {{ CompatGeckoMobile("31.0") }} {{ CompatNo() }} {{ CompatOperaMobile(43) }} {{ CompatNo() }} {{ CompatChrome(56.0) }}

参考