зеркало из https://github.com/mozilla/pluotsorbet.git
Merge pull request #573 from PinZhang/pzhang/keyrelease-issue
Fix LWUIT key release issue.
This commit is contained in:
Коммит
0f674a1d19
11
midp/midp.js
11
midp/midp.js
|
@ -872,12 +872,21 @@ MIDP.suppressKeyEvents = false;
|
|||
MIDP.keyPress = function(keyCode) {
|
||||
if (!MIDP.suppressKeyEvents)
|
||||
MIDP.sendNativeEvent({ type: MIDP.KEY_EVENT, intParam1: MIDP.PRESSED, intParam2: keyCode, intParam3: 0, intParam4: MIDP.displayId }, MIDP.foregroundIsolateId);
|
||||
}
|
||||
};
|
||||
|
||||
MIDP.keyRelease = function(keyCode) {
|
||||
if (!MIDP.suppressKeyEvents)
|
||||
MIDP.sendNativeEvent({ type: MIDP.KEY_EVENT, intParam1: MIDP.RELEASED, intParam2: keyCode, intParam3: 0, intParam4: MIDP.displayId }, MIDP.foregroundIsolateId);
|
||||
};
|
||||
|
||||
window.addEventListener("keypress", function(ev) {
|
||||
MIDP.keyPress(ev.which);
|
||||
});
|
||||
|
||||
window.addEventListener("keyup", function(ev) {
|
||||
MIDP.keyRelease(ev.which);
|
||||
});
|
||||
|
||||
Native.create("com/sun/midp/events/EventQueue.getNativeEventQueueHandle.()I", function() {
|
||||
return 0;
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче