--- title: Navigator.keyboard slug: Web/API/Navigator/keyboard translation_of: Web/API/Navigator/keyboard ---
{{SeeCompatTable}}{{APIRef("Keyboard API")}}

The keyboard read-only property of the {{domxref("navigator")}} interface returns a {{domxref('Keyboard')}} object which provides access to functions that retrieve keyboard layout maps and toggle capturing of key presses from the physical keyboard.

语法

var keyboard = navigator.keyboard

Value

一个 {{domxref('Keyboard')}} 对象.

规范

Specification Status Comment
{{SpecName('Keyboard Map','#navigator-interface','keyboard')}} {{Spec2('Keyboard Map')}} Initial definition.

浏览器兼容性

{{Compat("api.navigator.keyboard")}}