Пример #1
0
 @Override
 public boolean onKey(View v, int keyCode, android.view.KeyEvent event) {
   final com.jogamp.newt.event.KeyEvent[] newtEvents =
       AndroidNewtEventFactory.createKeyEvents(keyCode, event, WindowDriver.this);
   if (null != newtEvents) {
     for (int i = 0; i < newtEvents.length; i++) {
       WindowDriver.this.enqueueEvent(false, newtEvents[i]);
     }
     return true;
   }
   return false;
 }
Пример #2
0
 @Override
 public boolean onTouch(View v, android.view.MotionEvent event) {
   final com.jogamp.newt.event.MouseEvent[] newtEvents =
       AndroidNewtEventFactory.createMouseEvents(event, WindowDriver.this);
   if (null != newtEvents) {
     focusChanged(false, true);
     for (int i = 0; i < newtEvents.length; i++) {
       WindowDriver.this.enqueueEvent(false, newtEvents[i]);
     }
     try {
       Thread.sleep((long) (1000.0F / 30.0F));
     } catch (InterruptedException e) {
     }
     return true; // consumed/handled, further interest in events
   }
   return false; // no mapping, no further interest in the event!
 }