Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2014 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. | |
| 4 | |
| 5 // Mirrored in src/chrome/test/remoting/remote_test_helper.h | |
| 6 var Action = { | |
| 7 ERROR: -1, | |
|
Jamie
2015/01/06 19:31:39
Indentation.
Mike Meade
2015/01/08 18:58:42
Done.
| |
| 8 NONE: 0, | |
| 9 KEYDOWN: 1, | |
| 10 BUTTONPRESS: 2, | |
| 11 MOUSEMOVE: 3, | |
| 12 MOUSEWHEEL: 4, | |
| 13 DRAG: 5 | |
| 14 }; | |
| 15 | |
| 16 /** | |
| 17 * Method to handle sending keypress events to the server. | |
| 18 * @param {Event} event The event handler event. | |
| 19 **/ | |
| 20 function handleKeyPress(event) { | |
| 21 jsonRpc.setLastEvent(Action.KEYDOWN, event.keyCode, 0); | |
| 22 } | |
| 23 | |
| 24 /** | |
| 25 * Method to handle sending mouse down events to the server. | |
| 26 * @param {Event} event The event handler event. | |
| 27 **/ | |
| 28 function handleMouseDown(event) { | |
| 29 jsonRpc.setLastEvent(Action.BUTTONPRESS, event.button, 0); | |
| 30 } | |
| 31 | |
| 32 /** | |
| 33 * Method to handle sending mouse move events to the server. | |
| 34 * @param {Event} event The event handler event. | |
| 35 **/ | |
| 36 function handleMouseMove(event) { | |
| 37 jsonRpc.setLastEvent(Action.MOUSEMOVE, event.keyCode, 0); | |
| 38 } | |
| 39 | |
| 40 /** | |
| 41 * Method to handle sending mouse wheel events to the server. | |
| 42 * @param {Event} event The event handler event. | |
| 43 **/ | |
| 44 function handleMouseWheel(event) { | |
| 45 jsonRpc.setLastEvent(Action.MOUSEWHEEL, 0, 0); | |
| 46 } | |
| 47 | |
| 48 /** | |
| 49 * Method to handle sending drag events to the server. | |
| 50 * @param {Event} event The event handler event. | |
| 51 **/ | |
| 52 function handleDrag(event) { | |
| 53 jsonRpc.setLastEvent(Action.DRAG, 0, 0); | |
| 54 } | |
| 55 | |
| 56 window.addEventListener('keydown', handleKeyPress, false); | |
| 57 window.addEventListener('mousedown', handleMouseDown, false); | |
| 58 window.addEventListener('mousewheel', handleMouseWheel, false); | |
| 59 window.addEventListener('drag', handleDrag, false); | |
| 60 // window.addEventListener('mousemove', handleMouseMove, false) | |
| OLD | NEW |