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.
5 // Mirrored in src/chrome/test/remoting/remote_test_helper.h
17 * Method to handle sending keypress events to the server.
18 * @param {Event} event The event handler event.
20 function handleKeyPress(event) {
21 jsonRpc.setLastEvent(Action.Keydown, event.keyCode, 0);
25 * Method to handle sending mouse down events to the server.
26 * @param {Event} event The event handler event.
28 function handleMouseDown(event) {
29 jsonRpc.setLastEvent(Action.Buttonpress, event.button, 0);
33 * Method to handle sending mouse move events to the server.
34 * @param {Event} event The event handler event.
36 function handleMouseMove(event) {
37 jsonRpc.setLastEvent(Action.Mousemove, event.keyCode, 0);
41 * Method to handle sending mouse wheel events to the server.
42 * @param {Event} event The event handler event.
44 function handleMouseWheel(event) {
45 jsonRpc.setLastEvent(Action.Mousewheel, 0, 0);
49 * Method to handle sending drag events to the server.
50 * @param {Event} event The event handler event.
52 function handleDrag(event) {
53 jsonRpc.setLastEvent(Action.Drag, 0, 0);
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)