Class Pen
A pen/stylus input device.
Inherited Members
Namespace: UnityEngine.Experimental.Input
Syntax
public class Pen : Pointer, IInputStateCallbackReceiver
Remarks
Unlike mice but like touch, pens are absolute pointing devices moving across a fixed surface area.
The tip acts as a button that is considered pressed as long as the pen is in contact with the tablet surface.
Properties
current
The pen that was active or connected last or null
if there is no pen.
Declaration
public static Pen current { get; }
Property Value
Type | Description |
---|---|
Pen |
eraser
The eraser button of the pen, i.e. the button on the end opposite to the tip.
Declaration
public ButtonControl eraser { get; }
Property Value
Type | Description |
---|---|
ButtonControl |
Remarks
If the pen does not have an eraser button, this control will still be present but will not trigger.
firstBarrelButton
The button on the side of the pen barrel and located closer to the tip of the pen.
Declaration
public ButtonControl firstBarrelButton { get; }
Property Value
Type | Description |
---|---|
ButtonControl |
Remarks
If the pen does not have barrel buttons, this control will still be present but will not trigger.
inRange
Button control that indicates whether the pen is in range of the tablet surface or not.
Declaration
public ButtonControl inRange { get; }
Property Value
Type | Description |
---|---|
ButtonControl |
secondBarrelButton
The button on the side of the pen barrel and located closer to the eraser end of the pen.
Declaration
public ButtonControl secondBarrelButton { get; }
Property Value
Type | Description |
---|---|
ButtonControl |
Remarks
If the pen does not have barrel buttons, this control will still be present but will not trigger.
tip
The tip button of the pen.
Declaration
public ButtonControl tip { get; }
Property Value
Type | Description |
---|---|
ButtonControl |
Methods
FinishSetup(InputDeviceBuilder)
Declaration
protected override void FinishSetup(InputDeviceBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
InputDeviceBuilder | builder |
Overrides
MakeCurrent()
Declaration
public override void MakeCurrent()
Overrides
OnRemoved()
Declaration
protected override void OnRemoved()