--- 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. |