Class Pen | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class Pen

    A pen/stylus input device.

    Inheritance
    System.Object
    InputControl
    InputDevice
    Pointer
    Pen
    Inherited Members
    Pointer.position
    Pointer.delta
    Pointer.tilt
    Pointer.radius
    Pointer.pressure
    Pointer.twist
    Pointer.pointerId
    Pointer.phase
    Pointer.displayIndex
    Pointer.button
    Pointer.ResetDelta(Void*, InputControl<Single>)
    Pointer.AccumulateDelta(Void*, Void*, InputControl<Single>)
    InputDevice.kInvalidDeviceId
    InputDevice.description
    InputDevice.enabled
    InputDevice.canRunInBackground
    InputDevice.added
    InputDevice.remote
    InputDevice.native
    InputDevice.updateBeforeRender
    InputDevice.id
    InputDevice.lastUpdateTime
    InputDevice.wasUpdatedThisFrame
    InputDevice.allControls
    InputDevice.valueType
    InputDevice.valueSizeInBytes
    InputDevice.ReadValueFromStateAsObject(Void*)
    InputDevice.ReadValueFromStateIntoBuffer(Void*, Void*, Int32)
    InputDevice.CompareValue(Void*, Void*)
    InputDevice.OnAdded()
    InputDevice.ExecuteCommand<TCommand>(TCommand)
    InputControl.ReservedCharacters
    InputControl.name
    InputControl.displayName
    InputControl.shortDisplayName
    InputControl.path
    InputControl.layout
    InputControl.variants
    InputControl.device
    InputControl.parent
    InputControl.children
    InputControl.usages
    InputControl.aliases
    InputControl.stateBlock
    InputControl.noisy
    InputControl.synthetic
    InputControl.Item[String]
    InputControl.ToString()
    InputControl.EvaluateMagnitude()
    InputControl.EvaluateMagnitude(Void*)
    InputControl.WriteValueFromBufferIntoState(Void*, Int32, Void*)
    InputControl.WriteValueFromObjectIntoState(Object, Void*)
    InputControl.CompareState(Void*, Void*, Void*)
    InputControl.TryGetChildControl(String)
    InputControl.RefreshConfigurationIfNeeded()
    InputControl.RefreshConfiguration()
    InputControl.m_StateBlock
    InputControl.currentStatePtr
    InputControl.previousFrameStatePtr
    InputControl.defaultStatePtr
    InputControl.noiseMaskPtr
    InputControl.stateOffsetRelativeToDeviceRoot
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    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
    Pointer.FinishSetup(InputDeviceBuilder)

    MakeCurrent()

    Declaration
    public override void MakeCurrent()
    Overrides
    Pointer.MakeCurrent()

    OnRemoved()

    Declaration
    protected override void OnRemoved()
    Overrides
    Pointer.OnRemoved()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023