Class MouseDeviceImp
Mouse input device implementation for the Web platforms.
Inheritance
Implements
Inherited Members
Namespace: Fusee.Engine.Imp.Graphics.Blazor
Assembly: Fusee.Engine.Imp.Graphics.Blazor.dll
Syntax
public class MouseDeviceImp : IInputDeviceImpConstructors
MouseDeviceImp(IJSObjectReference, IJSRuntime)
Initializes a new instance of the MouseDeviceImp class.
Declaration
public MouseDeviceImp(IJSObjectReference canvas, IJSRuntime runtime)Parameters
| Type | Name | Description | 
|---|---|---|
| IJSObjectReference | canvas | The (JavaScript) canvas object. | 
| IJSRuntime | runtime | The Javascript runtime | 
Properties
AxesCount
Number of axes. Here seven: "X", "Y" and "Wheel" as well as MinX, MaxX, MinY and MaxY
Declaration
public int AxesCount { get; }Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
AxisImpDesc
Returns description information for all axes.
Declaration
public IEnumerable<AxisImpDescription> AxisImpDesc { get; }Property Value
| Type | Description | 
|---|---|
| System.Collections.Generic.IEnumerable<AxisImpDescription> | 
ButtonCount
Number of buttons exposed by this device. Here three: Left, Middle and Right mouse buttons.
Declaration
public int ButtonCount { get; }Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
ButtonImpDesc
A mouse exposes three buttons: left, middle and right.
Declaration
public IEnumerable<ButtonImpDescription> ButtonImpDesc { get; }Property Value
| Type | Description | 
|---|---|
| System.Collections.Generic.IEnumerable<ButtonImpDescription> | 
Category
Returns Mouse, just because it's a mouse.
Declaration
public DeviceCategory Category { get; }Property Value
| Type | Description | 
|---|---|
| DeviceCategory | 
Desc
Short description string for this device to be used in dialogs.
Declaration
public string Desc { get; }Property Value
| Type | Description | 
|---|---|
| System.String | 
Id
Returns a (hopefully) unique ID for this driver. Uniqueness is granted by using the full class name (including name space).
Declaration
public string Id { get; }Property Value
| Type | Description | 
|---|---|
| System.String | 
Methods
GetAxis(Int32)
Retrieves values for the X, Y and Wheel axes. No other axes are supported by this device.
Declaration
public float GetAxis(int iAxisId)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | iAxisId | The axis to retrieve information for. | 
Returns
| Type | Description | 
|---|---|
| System.Single | The value at the given axis. | 
GetButton(Int32)
This device does not support to-be-polled-buttons. All mouse buttons are event-driven. Listen to the ButtonValueChanged event to receive keyboard notifications from this device.
Declaration
public bool GetButton(int iButtonId)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | iButtonId | No matter what you specify here, you'll evoke an exception. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | No return, always throws. | 
Events
AxisValueChanged
This exposes mouseX and mouseY as event-based axes, while the mouseWheel is to be polled.
Declaration
public event EventHandler<AxisValueChangedArgs> AxisValueChangedEvent Type
| Type | Description | 
|---|---|
| System.EventHandler<AxisValueChangedArgs> | 
ButtonValueChanged
All three mouse buttons are event-based. Listen to this event to get information about mouse button state changes.
Declaration
public event EventHandler<ButtonValueChangedArgs> ButtonValueChangedEvent Type
| Type | Description | 
|---|---|
| System.EventHandler<ButtonValueChangedArgs> |