Get stylus pressure

edited September 2014 in Android Mode

Hey guys,

Does anyone have a working example of getting the pressure from stylus on Android. I'm looking at some sparse examples that look for the x and y but nothing on getPressure().

I saw an example that uses super to grab the events, but that goes way over my head. I would just love to capture the float value for my drawing app.

This is what I have so far and it returns nothing (or 0.0) ...

 import android.view.MotionEvent;
 public MotionEvent main_stylus;
 float main_stylusPressure = 0.1;


 @Override
 public boolean onTouchEvent(MotionEvent event) {

      main_stylusPressure = event.getPressure();   

 return true;

Answers

Sign In or Register to comment.