aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/RDGE/src/core/script/input.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/helper-classes/RDGE/src/core/script/input.js')
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/input.js117
1 files changed, 0 insertions, 117 deletions
diff --git a/js/helper-classes/RDGE/src/core/script/input.js b/js/helper-classes/RDGE/src/core/script/input.js
deleted file mode 100755
index 7622c5ab..00000000
--- a/js/helper-classes/RDGE/src/core/script/input.js
+++ /dev/null
@@ -1,117 +0,0 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */
6
7input = {}
8/*
9 * input.eventHandlers
10 * Register one or more event handlers with the input system. An event handler can be
11 * any object defining one or more of the following event handling functions:
12 * onKeyDown(ev)
13 * onKeyUp(ev)
14 * onMouseDown(ev)
15 * onMouseUp(ev)
16 * onMouseMove(ev)
17 * onMouseWheel(ev)
18 * ...
19 *
20 */
21input.eventHandlers = [];
22
23/*
24 * input.onKeyDown
25 * Top level onKeyDown event handler function. This function propogates events to all registered
26 * event handlers. The first handler to return true stops this propogation, thus "handling" the event.
27 */
28input.onKeyDown = function(ev) {
29 var i = 0;
30 var count = input.eventHandlers.length;
31 while( i < count ) {
32 if( input.eventHandlers[i].onKeyDown != undefined && input.eventHandlers[i].onKeyDown(ev) ) {
33 break;
34 }
35 i++;
36 }
37}
38
39/*
40 * input.onKeyUp
41 * Top level onKeyUp event handler function. This function propogates events to all registered
42 * event handlers. The first handler to return true stops this propogation, thus "handling" the event.
43 */
44input.onKeyUp = function(ev) {
45 var i = 0;
46 var count = input.eventHandlers.length;
47 while( i < count ) {
48 if( input.eventHandlers[i].onKeyUp != undefined && input.eventHandlers[i].onKeyUp(ev) ) {
49 break;
50 }
51 i++;
52 }
53}
54
55/*
56 * input.onMouseDown
57 * Top level onMouseDown event handler function. This function propogates events to all registered
58 * event handlers. The first handler to return true stops this propogation, thus "handling" the event.
59 */
60input.onMouseDown = function(ev) {
61 var i = 0;
62 var count = input.eventHandlers.length;
63 while( i < count ) {
64 if( input.eventHandlers[i].onMouseDown != undefined && input.eventHandlers[i].onMouseDown(ev) ) {
65 break;
66 }
67 i++;
68 }
69}
70
71/*
72 * input.onMouseUp
73 * Top level onMouseUp event handler function. This function propogates events to all registered
74 * event handlers. The first handler to return true stops this propogation, thus "handling" the event.
75 */
76input.onMouseUp = function(ev) {
77 var i = 0;
78 var count = input.eventHandlers.length;
79 while( i < count ) {
80 if( input.eventHandlers[i].onMouseUp != undefined && input.eventHandlers[i].onMouseUp(ev) ) {
81 break;
82 }
83 i++;
84 }
85}
86
87/*
88 * input.onMouseMove
89 * Top level onMouseMove event handler function. This function propogates events to all registered
90 * event handlers. The first handler to return true stops this propogation, thus "handling" the event.
91 */
92input.onMouseMove = function(ev) {
93 var i = 0;
94 var count = input.eventHandlers.length;
95 while( i < count ) {
96 if( input.eventHandlers[i].onMouseMove != undefined && input.eventHandlers[i].onMouseMove(ev) ) {
97 break;
98 }
99 i++;
100 }
101}
102
103/*
104 * input.onMouseWheel
105 * Top level onMouseWheel event handler function. This function propogates events to all registered
106 * event handlers. The first handler to return true stops this propogation, thus "handling" the event.
107 */
108input.onMouseWheel = function(ev) {
109 var i = 0;
110 var count = input.eventHandlers.length;
111 while( i < count ) {
112 if( input.eventHandlers[i].onMouseWheel != undefined && input.eventHandlers[i].onMouseWheel(ev) ) {
113 break;
114 }
115 i++;
116 }
117} \ No newline at end of file