SInput

Functions

GetKeyDown

bool GetKeyDown (string key)

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

Parameter
Type
Description
thisGameObject = Space.Host.ExecutingObject

OnUpdate = function()
  if Space.Input.GetKeyDown("space") then
 Space.Log("Jump Key Down")
  end
end

thisGameObject.OnUpdate(OnUpdate) 

GetKeyUp

bool GetKeyUp (string key)

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

Parameter
Type
Description

GetKey

bool GetKey (string key)

Returns true if 'key' is being held pressed.

Parameter
Type
Description

GetMouseDown

bool GetMouseDown (int button)

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

Parameter
Type
Description

button

int

button values are 0 for the primary button (often the left button), 1 for secondary button, and 2 for the middle button.

GetMouseUp

bool GetMouseUp (int button)

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

Parameter
Type
Description

button

int

button values are 0 for the primary button (often the left button), 1 for secondary button, and 2 for the middle button.

GetMouseHold

bool GetMouseHold (int button)

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

Parameter
Type
Description

button

int

button values are 0 for the primary button (often the left button), 1 for secondary button, and 2 for the middle button.

Vibrate

void Vibrate (float intensity, float duration, bool leftHand)

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

Parameter
Type
Description

intensity

float

Intensity of the vibration from 0.0 to 1.0

duration

float

Duration of the vibration. Maximum 1.0 second.

leftHand

bool

If true the vibration will be on the left hand and if false on the right hand (where applicable)

Properties

ScrollWheel

float ScrollWheel get

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

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.

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.

TurnAxis

SVector? TurnAxis get

Returns the Turn Axis (-1 to 1 on Vector's X value).


MouseLook

bool MouseLook get set

Enable or disable Mouse Look feature.

MouseX

float MouseX get

Returns a float representing the Mouse/Right Joystick horizontal movement. If the value is positive the movement is upwards. If the value is negative the movement is downwards. The value is derived by multiplying mouse delta with axis sensitivity. This is frame-rate independent; you do not need to be concerned about varying frame-rates when using this value.

MouseY

float MouseY get

Returns a float representing the Mouse/Right Joystick vertical movement. If the value is positive the movement is to the right. If the value is negative the movement is to the left. The value is derived by multiplying mouse delta with axis sensitivity. This is frame-rate independent; you do not need to be concerned about varying frame-rates when using this value.

ClickToWalk

SVector? TurnAxis get

Returns the Turn Axis (-1 to 1 on Vector's X value).

Fire

bool Fire get

Return true if primary fire is pressed (Mouselook Mode).

AltFire

bool AltFire get

Return true if alternative fire is pressed (Mouselook Mode)

CursorInUI

bool CursorInUI get

Returns true if the cursor is over the Sinespace UI.

IsVRAvailable

bool IsVRAvailable get

Returns true if VR is available.

IsVRActive

bool IsVRActive get

Returns true if VR is active.

VRLeftControllerPosition

SVector? VRLeftControllerPosition get

Returns position of Left VR Controller.

VRRightControllerPosition

SVector? VRRightControllerPosition get

Returns position of Right VR Controller.

VRLeftControllerRotation

SQuaternion? VRLeftControllerRotation get

Returns rotation of Left VR Controller.

VRRightControllerRotation

SQuaternion? VRRightControllerRotation get

Returns rotation of Right VR Controller.

Input Key Names

Key names follow these naming conventions:

Key family

Naming convention

Letter keys

a, b, c

Number keys

1, 2, 3

Arrow keys

up, down, left, right

Numpad keys

[1], [2], [3], [+], [equals]

Modifier keys

right shift, left shift, right ctrl, left ctrl, right alt, left alt, right cmd, left cmd

Special keys

backspace, tab, return, escape, space, delete, enter, insert, home, end, page up, page down

Function keys

f1, f2, f3

Mouse buttons are named mouse 0, mouse 1, mouse 2, and so on.

Joystick buttons follow these naming conventions:

Button origin

Naming convention

A specific button on any joystick

joystick button 0, joystick button 1, joystick button 2

A specific button on a specific joystick

joystick 1 button 0, joystick 1 button 1, joystick 2 button 0

Last updated

Was this helpful?