--- title: KeyboardEvent.repeat slug: Web/API/KeyboardEvent/repeat tags: - KeyboardEvent translation_of: Web/API/KeyboardEvent/repeat ---
{{APIRef("DOM Events")}}
KeyboardEvent.repeat
是一个只读属性,返回一个布尔值{{jsxref("Boolean")}},如果按键被一直按住,返回值为true
。
var repeat = event.repeat;
Specification | Status | Comment |
---|---|---|
{{SpecName('DOM3 Events', '#widl-KeyboardEvent-repeat', 'KeyboardEvent.repeat')}} | {{Spec2('DOM3 Events')}} | Initial definition. |
{{ CompatibilityTable() }}
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | {{ CompatUnknown() }} | {{CompatVersionUnknown}} | {{ CompatGeckoDesktop(28) }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} |
Feature | Android | Edge | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | {{ CompatUnknown() }} | {{CompatVersionUnknown}} | {{ CompatGeckoMobile(28) }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} |