| 1 | /*! |
| 2 | * VisualEditor ContentEditable key down handler |
| 3 | * |
| 4 | * @copyright See AUTHORS.txt |
| 5 | */ |
| 6 | |
| 7 | /* istanbul ignore next */ |
| 8 | /** |
| 9 | * Key down handler. |
| 10 | * |
| 11 | * @class |
| 12 | * @abstract |
| 13 | * |
| 14 | * @constructor |
| 15 | */ |
| 16 | ve.ce.KeyDownHandler = function VeCeKeyDownHandler() { |
| 17 | }; |
| 18 | |
| 19 | /* Inheritance */ |
| 20 | |
| 21 | OO.initClass( ve.ce.KeyDownHandler ); |
| 22 | |
| 23 | /* Static properties */ |
| 24 | |
| 25 | /** |
| 26 | * Symbolic name for this handler. Must be unique. |
| 27 | * |
| 28 | * @static |
| 29 | * @property {string} |
| 30 | * @inheritable |
| 31 | */ |
| 32 | ve.ce.KeyDownHandler.static.name = null; |
| 33 | |
| 34 | /** |
| 35 | * List of keys this handler matches |
| 36 | * |
| 37 | * @static |
| 38 | * @property {string[]|null} |
| 39 | * @inheritable |
| 40 | */ |
| 41 | ve.ce.KeyDownHandler.static.keys = []; |
| 42 | |
| 43 | /** |
| 44 | * List of selections this handler matches |
| 45 | * |
| 46 | * Null means all selections are matched. |
| 47 | * |
| 48 | * @static |
| 49 | * @property {string[]|null} |
| 50 | * @inheritable |
| 51 | */ |
| 52 | ve.ce.KeyDownHandler.static.supportedSelections = null; |
| 53 | |
| 54 | /* Static methods */ |
| 55 | |
| 56 | /** |
| 57 | * Execute the handler |
| 58 | * |
| 59 | * @abstract |
| 60 | * @method |
| 61 | * @param {ve.ce.Surface} surface |
| 62 | * @param {jQuery.Event} e Key down event |
| 63 | * @return {boolean} Whether an action was taken |
| 64 | */ |
| 65 | ve.ce.KeyDownHandler.static.execute = null; |