public boolean onKeyDown(int keyCode, KeyEvent event) {
   if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
     event.startTracking();
     return true;
   }
   return super.onKeyDown(keyCode, event);
 }
  /** {@inheritDoc} */
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK) {
      event.startTracking();
      return true;
    }

    return false;
  }
 @Override
 public boolean onKeyDown(int keyCode, KeyEvent event) {
   if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
     event.startTracking();
     return true;
   }
   return false;
 };
 @Override
 public boolean onKeyDown(int keyCode, KeyEvent event) {
   if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
     event.startTracking();
     return true;
   }
   if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
     event.startTracking();
     return true;
   }
   if (keyCode == KeyEvent.KEYCODE_HEADSETHOOK) {
     Intent record = new Intent(getActivity(), VoiceQuickRecordActivity.class);
     record.putExtra("feed_uri", mFeedUri);
     startActivity(record);
     return true;
   }
   return false;
 }
  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    event.startTracking();
    // Capture our buttons' keyDown events so the OS doesn't take them and do something we don't
    // want
    switch (keyCode) {
      case KeyEvent.KEYCODE_VOLUME_UP:
        if (Params.TAG_FG_DEBUG && fgDebugLocal) {
          Log.i(Params.TAG_GEN, TAG_LOCAL + "KEYCODE_VOLUME_UP");
        }
        ;
        if (camera != null) {
          camera.release();
          camera = null;
        }
        chatService.stop();
        intent = new Intent(ConnexionBluetooth.this, GPS.class);
        startActivity(intent);
        finish();
        return true;
      case KeyEvent.KEYCODE_VOLUME_DOWN:
        if (Params.TAG_FG_DEBUG && fgDebugLocal) {
          Log.i(Params.TAG_GEN, TAG_LOCAL + "KEYCODE_VOLUME_DOWN");
        }
        ;

        if (camera != null) {
          camera.release();
          camera = null;
        }
        chatService.stop();
        intent = new Intent(ConnexionBluetooth.this, Home.class);
        startActivity(intent);
        finish();
        return true;
      case KeyEvent.KEYCODE_BACK:
        if (Params.TAG_FG_DEBUG && fgDebugLocal) {
          Log.i(Params.TAG_GEN, TAG_LOCAL + "KEYCODE_BACK");
        }
        ;
        if (camera != null) {
          camera.release();
          camera = null;
        }
        chatService.stop();
        intent = new Intent(ConnexionBluetooth.this, GPS.class);
        startActivity(intent);
        finish();
        return true;
    }
    return false;
  }
Beispiel #6
0
  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_MENU) {
      event.startTracking();
      return true;
    } else if (keyCode == KeyEvent.KEYCODE_BACK && menuLongPress) {
      menuLongPress = false;
      mTicketScannerActivity.maintenance();
      return true;
    } else if (keyCode == KeyEvent.KEYCODE_FOCUS
        || keyCode == KeyEvent.KEYCODE_CAMERA
        || keyCode == KeyEvent.KEYCODE_SEARCH) {
      return true;
    }

    return super.onKeyDown(keyCode, event);
  }
Beispiel #7
0
  @Override
  public boolean onKey(View v, int keyCode, KeyEvent event) {
    if (mPopup == null || mPopup.getListView() == null) return false;

    if (event.getKeyCode() == KeyEvent.KEYCODE_MENU) {
      if (event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount() == 0) {
        event.startTracking();
        v.getKeyDispatcherState().startTracking(event, this);
        return true;
      } else if (event.getAction() == KeyEvent.ACTION_UP) {
        v.getKeyDispatcherState().handleUpEvent(event);
        if (event.isTracking() && !event.isCanceled()) {
          dismiss();
          return true;
        }
      }
    }
    return false;
  }
 public static boolean a(KeyEvent paramKeyEvent) {
   if (paramKeyEvent.getRepeatCount() == 0) paramKeyEvent.startTracking();
   for (int i = 1; ; i = 0) return i;
 }
 public static void a(KeyEvent keyevent) {
   keyevent.startTracking();
 }