Android Open Source - GlassSensorTest Input Handler






From Project

Back to project page GlassSensorTest.

License

The source code is released under:

Apache License

If you think the Android project GlassSensorTest listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.prt.sensor;
/*from  w w  w  . j  ava2 s .  com*/
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputProcessor;

public class InputHandler implements InputProcessor {
  
  private TestSensor testSensor;
  
  public InputHandler(TestSensor app) {
    testSensor = app;
  }
  

  @Override
  public boolean keyDown(int keycode) {
    switch (Gdx.app.getType()) {
    case Android:
      if (keycode == 23)
        testSensor.toggleFile();
      return true;
    default:
      break;
    }
    return false;
  }

  @Override
  public boolean keyUp(int keycode) {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public boolean keyTyped(char character) {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public boolean touchDown(int screenX, int screenY, int pointer, int button) {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public boolean touchUp(int screenX, int screenY, int pointer, int button) {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public boolean touchDragged(int screenX, int screenY, int pointer) {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public boolean mouseMoved(int screenX, int screenY) {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public boolean scrolled(int amount) {
    // TODO Auto-generated method stub
    return false;
  }

}




Java Source Code List

com.prt.sensor.InputHandler.java
com.prt.sensor.LinearAcceleration.java
com.prt.sensor.MyGestureListener.java
com.prt.sensor.TestSensor.java
com.prt.sensor.android.AndroidLauncher.java
com.prt.sensor.android.AndroidLinearAcceleration.java
com.prt.sensor.desktop.DesktopLauncher.java