Merge pull request #573 from PinZhang/pzhang/keyrelease-issue

Fix LWUIT key release issue.
This commit is contained in:
Marco 2014-11-12 10:38:48 +01:00
Родитель 319da28c78 c81521a90d
Коммит 0f674a1d19
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -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;
});