wiki.sine.space | sinespace

Scripting/SInput

From wiki.sine.space
Revision as of 17:33, 24 December 2020 by Voidtech (Talk | contribs) (Added and defined .Vibrate Clicktowalk AltFire Fire isVRActive isVRAvailable MouseLook TurnAxis VRLeftControllerPosition VRLeftControllerRotation VRRightControllerPosition VRRightControllerRotation)

Jump to: navigation, search

The SInput class returns the current state of input devices connected to the players device.

Keys

To ensure a cross-platform experience that works with Game Pads, Keyboards, Mouse and Mobile devices - as well as foreign language keyboards, we do not allow you to listen for specific keyboard keys, instead you may listen to predefined key groups which are consistent across devices. These can be used where ever a function argument is named 'key'.

Keys

  • Jump (usually spacebar)
  • Fly (usually f)
  • Run (usually left shift)
  • Submit (usually return key)
  • Cancel (usually escape)
  • Tab Horiz (usually tab key)
  • Tab Vert (gamepad only)

Members

GetKeyDown

bool GetKeyDown (string key);

Returns true if 'key' was pressed during this frame.

No example provided yet


GetKey

bool GetKey (string key);

Returns true if 'key' is being held pressed.

No example provided yet


GetKeyUp

bool GetKeyUp (string key);

Returns true if 'key' is no longer pressed during this frame (but was in the last).

No example provided yet


GetMouseDown

bool GetMouseDown (int button);

Returns true if mouse 'button' was pressed during this frame.

No example provided yet


GetMouseHold

bool GetMouseHold (int button);

Returns true if mouse 'button' is being held pressed.

No example provided yet


GetMouseUp

bool GetMouseUp (int button);

Returns true if mouse 'button' is no longer pressed during this frame (but was in the last).

No example provided yet


Vibrate

void Vibrate ()

Vibrates the controller (or phone, or gamepad) if a rumble device is present.



Properties

ScrollWheel

float ScrollWheel { get; }

Returns a non-0 value if the mouse wheel is being scrolled, value usually ranges from -1 to 1

No example provided yet


MousePosition

SVector MousePosition { get; }

Returns the current position of the mouse in screen pixels. If on a touch screen device, this will also return the location of the first finger being pressed.

No example provided yet


MovementAxis

SVector MovementAxis { get; }

Returns left/right (A/D) movement on X, forward/back (W/S) on Y, and up/down (E/C) on Z

No example provided yet


ClickToWalk

bool ClickToWalk { get; set; }

Enable or disable Click To Walk feature which allows movement of avatar by clicking the ground.


AltFire

bool AltFire { get; }

Return true if alternative fire is pressed


Fire

bool Fire { get; }

Return true if primary fire is pressed


IsVRActive

bool IsVRActive { get; }

Returns true if VR is active


IsVRAvailable

bool IsVRAvailable { get; }

Returns true if VR is available


MouseLook

bool MouseLook { get;set; }

Enable or disable Mouse Look feature


TurnAxis

SVector TurnAxis { get; }

Returns the position of the axis of turning


VRLeftControllerPosition

SVector VRLeftControllerPosition { get; }

Returns position of Left VR Controller


VRLeftControllerRotation

SQuaternion VRLeftControllerRotation { get; }

Return rotation of Left VR Controller


VRRightControllerPosition

SVector VRRightControllerPosition { get; }

Returns position of Right VR Controller


VRRightControllerRotation

SQuaternion VRRightControllerRotation { get; }

Return rotation of Right VR Controller