File tree 4 files changed +29
-24
lines changed
4 files changed +29
-24
lines changed Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
1
3
import config from '@config/config.json' ;
4
+ import { Plugin } from '@plugins/plugin.js' ;
2
5
3
- class KeyboardInput {
6
+ class KeyboardInput extends Plugin {
4
7
constructor ( ) {
5
- this . usedByAComponent = true ;
8
+ super ( ) ;
6
9
this . type = 'inputEvent' ;
7
- this . callbacks = [ ] ;
8
- this . initialized = false ;
9
- }
10
-
11
- onEvent ( callback ) {
12
- this . callbacks . push ( callback ) ;
13
10
}
14
11
15
12
init ( ) {
Original file line number Diff line number Diff line change 1
- class TouchPointerInput {
1
+ 'use strict' ;
2
+
3
+ import { Plugin } from '@plugins/plugin.js' ;
4
+
5
+ class TouchPointerInput extends Plugin {
2
6
constructor ( ) {
3
- this . usedByAComponent = true ;
7
+ super ( ) ;
4
8
this . type = 'touchPointerEvent' ;
5
- this . callbacks = [ ] ;
6
9
this . zooming = false ;
7
10
this . pointer = { x : 0 , y : 0 , color : '#FF0000' } ;
8
11
this . interval ;
9
12
this . messageEventRegistered = false ;
10
- this . initialized = false ;
11
- }
12
-
13
- onEvent ( callback ) {
14
- this . callbacks . push ( callback ) ;
15
13
}
16
14
17
15
init ( ) {
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
1
3
import contextService from '@services/context' ;
4
+ import { Plugin } from '@plugins/plugin.js' ;
2
5
3
- class TouchInput {
6
+ class TouchInput extends Plugin {
4
7
constructor ( ) {
5
- this . usedByAComponent = true ;
8
+ super ( ) ;
6
9
this . type = 'inputEvent' ;
7
10
this . touchPosition = {
8
11
touchstart : { clientX : 0 , clientY : 0 } ,
9
12
touchend : { clientX : 0 , clientY : 0 }
10
13
} ;
11
- this . callbacks = [ ] ;
12
- this . initialized = false ;
13
- }
14
-
15
- onEvent ( callback ) {
16
- this . callbacks . push ( callback ) ;
17
14
}
18
15
19
16
init ( ) {
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ export class Plugin {
4
+ constructor ( ) {
5
+ this . usedByAComponent = true ;
6
+ this . initialized = false ;
7
+ this . callbacks = [ ] ;
8
+ }
9
+
10
+ onEvent ( callback ) {
11
+ this . callbacks . push ( callback ) ;
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments