Skip to content

Commit 4c50e75

Browse files
author
Michael Fiess
authored
updated key handling support for optimus launched apps (#1243)
1 parent da2b092 commit 4c50e75

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

examples/pxScene2d/src/rcvrcore/optimus.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,21 @@ function Application(props) {
147147
_externalApp.focus = true;
148148
}
149149
};
150+
this.onKeyDown = function(e) {
151+
if (_externalApp && _externalApp.onKeyDown !== undefined && typeof _externalApp.onKeyDown === "function" ){
152+
_externalApp.onKeyDown(e);
153+
}
154+
};
155+
this.onKeyUp = function(e) {
156+
if (_externalApp && _externalApp.onKeyUp !== undefined && typeof _externalApp.onKeyUp === "function" ){
157+
_externalApp.onKeyUp(e);
158+
}
159+
};
160+
this.onChar = function(e) {
161+
if (_externalApp && _externalApp.onChar !== undefined && typeof _externalApp.onChar === "function" ){
162+
_externalApp.onChar(e);
163+
}
164+
};
150165
this.animateTo = function(animationProperties, duration, tween, type, count) {
151166
if (_externalApp){
152167
return _externalApp.animateTo(animationProperties, duration, tween, type, count);

0 commit comments

Comments
 (0)