diff options
author | Nivesh Rajbhandari | 2012-04-04 15:53:53 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-04-04 15:53:53 -0700 |
commit | b06dbed626994db7bf41e12a712b5289a1306b50 (patch) | |
tree | bee299aae4f4dcac507236f59fdfc3768f9a6b05 /js/helper-classes/RDGE/src/core/script/input.js | |
parent | db0fa4e454b76d8a2bd6ba47c6f10166761179e7 (diff) | |
parent | e721a7c1009f298a1bd8fea583da14535e039880 (diff) | |
download | ninja-b06dbed626994db7bf41e12a712b5289a1306b50.tar.gz |
Merge branch 'refs/heads/ninja-internal' into ToolFixes
Diffstat (limited to 'js/helper-classes/RDGE/src/core/script/input.js')
-rwxr-xr-x | js/helper-classes/RDGE/src/core/script/input.js | 117 |
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> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No 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 | |||
7 | input = {} | ||
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 | */ | ||
21 | input.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 | */ | ||
28 | input.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 | */ | ||
44 | input.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 | */ | ||
60 | input.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 | */ | ||
76 | input.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 | */ | ||
92 | input.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 | */ | ||
108 | input.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 | ||