1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Braille display access private API.
6 namespace brailleDisplayPrivate
{
7 // Braille display keyboard command.
21 // A keyboard event. This is not a standard keyboard event because
22 // braille display keyboards look significantly different from standard
26 // 0-based display position for commands that involve a routing key.
27 long? displayPosition
;
28 // Braille dot keys that were pressed, stored in the low-order bits.
29 // Dot 1 is stored in bit 0, dot2 in bit 1, etc.
31 // DOM keyboard event for a key that corresponds to a standard key.
32 DOMString? standardKeyName
;
33 // Whether the space key was pressed.
35 // Whether the alt key was pressed.
37 // Whether the shift key was pressed.
39 // Whether the ctrl key was pressed.
43 // The current braille display state.
44 dictionary DisplayState
{
45 // Whether a braille display is currently available.
47 // Number of braille cells on the currently connected display.
51 callback DisplayStateCallback
= void(DisplayState result
);
54 // Gets the current display state.
55 static
void getDisplayState
(DisplayStateCallback
callback);
56 // Write the given dot patterns to the display. The buffer contains one
57 // byte for each braille cell on the display, starting from the leftmost
58 // cell. Each byte contains a bit pattern indicating which dots should be
59 // raised in the corresponding cell with the low-order bit representing
60 // dot 1 and so on until bit 7 which corresponds to dot 8. If the number
61 // of bytes in the buffer is not equal to the display size, the buffer
62 // will either be clipped or padded with blank cells on the right.
63 static
void writeDots
(ArrayBuffer cells
);
67 // Fired when a braille display is connected or disconnected.
68 static
void onDisplayStateChanged
(DisplayState state
);
69 // Fired when an input event is received from the display.
70 static
void onKeyEvent
(KeyEvent event
);