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

兼容性

{{Compat("api.KeyboardEvent.repeat")}}