Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here you go (from the Android documentation) - seems to only be supported in 4.0 and up though. <a href="http://developer.android.com/about/versions/android-4.0.html" rel="nofollow">http://developer.android.com/about/versions/android-4.0.html</a></p> <blockquote> <p>Android now provides APIs for receiving input from a stylus input device such as a digitizer tablet peripheral or a stylus-enabled touch screen.</p> <p>Stylus input operates in a similar manner to touch or mouse input. When the stylus is in contact with the digitizer, applications receive touch events just like they would when a finger is used to touch the display. When the stylus is hovering above the digitizer, applications receive hover events just like they would when a mouse pointer was being moved across the display when no buttons are pressed.</p> <p>Your application can distinguish between finger, mouse, stylus and eraser input by querying the “tool type" associated with each pointer in a MotionEvent using <em>getToolType()</em>. The currently defined tool types are: <strong>TOOL_TYPE_UNKNOWN</strong>, <strong>TOOL_TYPE_FINGER</strong>, <strong>TOOL_TYPE_MOUSE</strong>, <strong>TOOL_TYPE_STYLUS</strong>, and <strong>TOOL_TYPE_ERASER</strong>. By querying the tool type, your application can choose to handle stylus input in different ways from finger or mouse input.</p> <p>Your application can also query which mouse or stylus buttons are pressed by querying the “button state" of a MotionEvent using <em>getButtonState()</em>. The currently defined button states are: <strong>BUTTON_PRIMARY</strong>, <strong>BUTTON_SECONDARY</strong>, <strong>BUTTON_TERTIARY</strong>, <strong>BUTTON_BACK</strong>, and <strong>BUTTON_FORWARD</strong>. For convenience, the back and forward mouse buttons are automatically mapped to the <strong>KEYCODE_BACK</strong> and <strong>KEYCODE_FORWARD</strong> keys. Your application can handle these keys to support mouse button based back and forward navigation.</p> <p>In addition to precisely measuring the position and pressure of a contact, some stylus input devices also report the distance between the stylus tip and the digitizer, the stylus tilt angle, and the stylus orientation angle. Your application can query this information using <em>getAxisValue()</em> with the axis codes <strong>AXIS_DISTANCE</strong>, <strong>AXIS_TILT</strong>, and <strong>AXIS_ORIENTATION</strong>.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload