(int offset, int[] inputEventStackTmp)
| 2476 | |
| 2477 | /// Invoked on the EDT to propagate the event |
| 2478 | private int handleEvent(int offset, int[] inputEventStackTmp) { |
| 2479 | Form f = getCurrentUpcomingForm(true); |
| 2480 | |
| 2481 | // might happen when returning from a deinitialized version of Codename One |
| 2482 | if (f == null) { |
| 2483 | return offset; |
| 2484 | } |
| 2485 | |
| 2486 | // no need to synchronize since we are reading only and modifying the stack frame offset |
| 2487 | int type = inputEventStackTmp[offset]; |
| 2488 | offset++; |
| 2489 | |
| 2490 | switch (type) { |
| 2491 | case KEY_PRESSED: |
| 2492 | f.keyPressed(inputEventStackTmp[offset]); |
| 2493 | offset++; |
| 2494 | eventForm = f; |
| 2495 | break; |
| 2496 | case KEY_RELEASED: |
| 2497 | // pointer release can cycle into invoke and block which will cause this method |
| 2498 | // to recurse if a pointer will be released while we are in an invoke and block state |
| 2499 | // this is the case in http://code.google.com/p/codenameone/issues/detail?id=265 |
| 2500 | Form xf = eventForm; |
| 2501 | eventForm = null; |
| 2502 | |
| 2503 | //make sure the released event is sent to the same Form who got a |
| 2504 | //pressed event |
| 2505 | if (xf == f || multiKeyMode) { //NOPMD CompareObjectsWithEquals |
| 2506 | f.keyReleased(inputEventStackTmp[offset]); |
| 2507 | offset++; |
| 2508 | } |
| 2509 | break; |
| 2510 | case POINTER_PRESSED: |
| 2511 | if (recursivePointerReleaseA) { |
| 2512 | recursivePointerReleaseB = true; |
| 2513 | } |
| 2514 | dragOccured = false; |
| 2515 | dragPathLength = 0; |
| 2516 | pointerPressedAndNotReleasedOrDragged = true; |
| 2517 | xArray1[0] = inputEventStackTmp[offset]; |
| 2518 | offset++; |
| 2519 | yArray1[0] = inputEventStackTmp[offset]; |
| 2520 | offset++; |
| 2521 | currentPointerEvent = impl.buildPointerEvent(xArray1[0], yArray1[0], false); |
| 2522 | f.pointerPressed(xArray1, yArray1); |
| 2523 | eventForm = f; |
| 2524 | break; |
| 2525 | case POINTER_PRESSED_MULTI: { |
| 2526 | if (recursivePointerReleaseA) { |
| 2527 | recursivePointerReleaseB = true; |
| 2528 | } |
| 2529 | dragOccured = false; |
| 2530 | dragPathLength = 0; |
| 2531 | pointerPressedAndNotReleasedOrDragged = true; |
| 2532 | int[] array1 = readArrayStackArgument(inputEventStackTmp, offset); |
| 2533 | offset += array1.length + 1; |
| 2534 | int[] array2 = readArrayStackArgument(inputEventStackTmp, offset); |
| 2535 | offset += array2.length + 1; |
no test coverage detected