android.view.SurfaceView.onKeyDown()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(173)

本文整理了Java中android.view.SurfaceView.onKeyDown()方法的一些代码示例,展示了SurfaceView.onKeyDown()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SurfaceView.onKeyDown()方法的具体详情如下:
包路径:android.view.SurfaceView
类名称:SurfaceView
方法名:onKeyDown

SurfaceView.onKeyDown介绍

暂无

代码示例

代码示例来源:origin: HotBitmapGG/bilibili-android-client

return super.onKeyDown(keyCode, event);

代码示例来源:origin: ymcao/YaPlayer

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: mrmaffen/vlc-android-sdk

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: pedroSG94/vlc-example-streamplayer

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: wobiancao/RtspServerAndVlcPlay

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: curtis2/SuperVideoPlayer

return super.onKeyDown(keyCode, event);

代码示例来源:origin: IvanVolosyuk/diskusage

@Override
public final boolean onKeyDown(final int keyCode, final KeyEvent event) {
 thread.addEvent(new Runnable() {
  @Override
  public void run() {
   eventHandler.onKeyDown(keyCode, event);
  }
 });
 switch (keyCode) {
  case KeyEvent.KEYCODE_BACK:
  case KeyEvent.KEYCODE_DPAD_CENTER:
  case KeyEvent.KEYCODE_DPAD_LEFT:
  case KeyEvent.KEYCODE_DPAD_RIGHT:
  case KeyEvent.KEYCODE_DPAD_UP:
  case KeyEvent.KEYCODE_DPAD_DOWN:
  case KeyEvent.KEYCODE_SEARCH:
   return true;
 };
 return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: AlexMofer/ZxingScanView

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  switch (keyCode) {
    case KeyEvent.KEYCODE_FOCUS:
    case KeyEvent.KEYCODE_CAMERA:
      return true;
    case KeyEvent.KEYCODE_VOLUME_DOWN:
      setAmbientLightMode(AmbientLightManager.MODE_CLOSE);
      return true;
    case KeyEvent.KEYCODE_VOLUME_UP:
      setAmbientLightMode(AmbientLightManager.MODE_OPEN);
      return true;
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: AlexMofer/ProjectX

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  switch (keyCode) {
    case KeyEvent.KEYCODE_FOCUS:
    case KeyEvent.KEYCODE_CAMERA:
      return true;
    case KeyEvent.KEYCODE_VOLUME_DOWN:
      setAmbientLightMode(AmbientLightManager.MODE_CLOSE);
      return true;
    case KeyEvent.KEYCODE_VOLUME_UP:
      setAmbientLightMode(AmbientLightManager.MODE_OPEN);
      return true;
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: Gamelab-Istanbul/NgdroidApp

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (keyCode == KeyEvent.KEYCODE_BACK) {
    if (canvasmanager.isCanvasShown()) return canvasmanager.currentCanvas.backPressed();
    else return ngapp.backPressed();
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: Gentleman-jun/VideoRecordDemo

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (mIsPrepared && keyCode != KeyEvent.KEYCODE_BACK
      && keyCode != KeyEvent.KEYCODE_VOLUME_UP
      && keyCode != KeyEvent.KEYCODE_VOLUME_DOWN
      && keyCode != KeyEvent.KEYCODE_MENU
      && keyCode != KeyEvent.KEYCODE_CALL
      && keyCode != KeyEvent.KEYCODE_ENDCALL && mMediaPlayer != null
      && mmMediaController != null) {
    if (keyCode == KeyEvent.KEYCODE_HEADSETHOOK
        || keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE) {
      if (mMediaPlayer.isPlaying()) {
        pause();
        mmMediaController.show();
      } else {
        start();
        mmMediaController.hide();
      }
      return true;
    } else if (keyCode == KeyEvent.KEYCODE_MEDIA_STOP
        && mMediaPlayer.isPlaying()) {
      pause();
      mmMediaController.show();
    } else {
      toggleMediaControlsVisiblity();
    }
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: mrgames13/SplashScreen

return super.onKeyDown(keyCode, event);

代码示例来源:origin: gpfduoduo/AirPlay-Receiver-on-Android

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
 boolean isKeyCodeSupported = keyCode != KeyEvent.KEYCODE_BACK && keyCode != KeyEvent.KEYCODE_VOLUME_UP && keyCode != KeyEvent.KEYCODE_VOLUME_DOWN && keyCode != KeyEvent.KEYCODE_MENU && keyCode != KeyEvent.KEYCODE_CALL && keyCode != KeyEvent.KEYCODE_ENDCALL;
 if (isInPlaybackState() && isKeyCodeSupported && mMediaController != null) {
  if (keyCode == KeyEvent.KEYCODE_HEADSETHOOK || keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE || keyCode == KeyEvent.KEYCODE_SPACE) {
   if (mMediaPlayer.isPlaying()) {
    pause();
    mMediaController.show();
   } else {
    start();
    mMediaController.hide();
   }
   return true;
  } else if (keyCode == KeyEvent.KEYCODE_MEDIA_STOP && mMediaPlayer.isPlaying()) {
   pause();
   mMediaController.show();
  } else {
   toggleMediaControlsVisiblity();
  }
 }
 return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: ExcaliburZ/ImitateBilibili

return super.onKeyDown(keyCode, event);

代码示例来源:origin: yoyiyi/bilisoleil

return super.onKeyDown(keyCode, event);

代码示例来源:origin: whyalwaysmea/BigBoom

return super.onKeyDown(keyCode, event);

代码示例来源:origin: yixia/VitamioBundleStudio

return super.onKeyDown(keyCode, event);

代码示例来源:origin: XieShengda/FakeDouyu

return super.onKeyDown(keyCode, event);

代码示例来源:origin: hezhubo/HPlayer

return super.onKeyDown(keyCode, event);

相关文章