s&
family_starAbout
newspaperBlog
published_with_changesChanges
gamesGames
business_centerWorkshop
sprintDashboard
sprintGame Charts
delivery_truck_speedMap Charts
forumForum
docsDocs
docsDocumentation
dashboardApi Reference
inputLog in with Steam
chevron_leftChange Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية

Static Properties

data_objectActionNames
data_objectAnalogLook
data_objectAnalogMove
data_objectControllerCount
data_objectEnableVirtualCursor
data_objectEscapePressed
data_objectMotionData
data_objectMouseCursorVisible
data_objectMouseDelta
data_objectMouseWheel
data_objectSuppressed
data_objectUsingController
data_objectVR

Static Methods

functionsClear
functionsClearActions
functionsDown
functionsGetActions
functionsGetAnalog
functionsGetButtonOrigin
functionsGetGlyph
functionsGetGroupName
functionsPlayerScope
functionsPressed
functionsReleaseAction
functionsReleaseActions
functionsReleased
functionsSetAction
functionsStopAllHaptics
functionsTriggerHaptics
menu
Api
Input
Input
Input
Sandbox.Input  
staticsealedabstractclassAssembly: Sandbox.Engine

Summary

Allows querying of player button presses and other inputs.

Static Properties

ActionNames Names of all actions from the current game's input settings.
AnalogLook Analog look value from the default input device. This is scaled by Preferences.Sensitivity - so you don't need to scale it afterwards.
AnalogMove Analog move value from the default input device.
ControllerCount How many controllers are active right now?
EnableVirtualCursor Whether or not the Virtual Cursor should show when using a controller. Disable this to control the cursor manually.
EscapePressed True if escape was pressed
MotionData Current state of the current input device's motion sensor(s) if supported. This is only supported on: Dualshock 4+, Switch Controllers, Steam Controller, Steam Deck.
MouseCursorVisible True if the mouse cursor is visible (using UI etc)
MouseDelta Movement delta from the mouse.
MouseWheel The state of the mouse wheel.
Suppressed If the input is suppressed then everything will act like there is no input
UsingController Was the last button pressed a game controller button?
VR Virtual Reality specific input data.

Static Methods

Clear Remove this action, so it's no longer being pressed.
ClearActions Clears the current input actions, so that none of them are active.
Down Action is currently pressed down
GetActions Copies all input actions to be used publicly
GetAnalog An analog input, when fetched, is between -1 and 1 (0 being default)
GetButtonOrigin Returns the name of a key bound to this InputAction <example>For example: <code>Input.GetButtonOrigin( "Undo" )</code> could return <c>SPACE</c> if using keyboard or <c>A Button</c> when using a controller. </example>
GetGlyph Get a glyph texture from the controller bound to the action. If no binding is found will return an 'UNBOUND' glyph.
GetGroupName Finds the Sandbox.InputAction.GroupName of the given action.
PlayerScope Push a specific player scope to be active
Pressed Action wasn't pressed but now it is
ReleaseAction Releases the action, and it won't be active again until it's pressed again.
ReleaseActions Clears the current input actions, so that none of them are active. Unlike ClearActions this will unpress the buttons, so they won't be active again until they're pressed again.
Released Action was pressed but now it isn't
SetAction
StopAllHaptics Stop all vibration events on the current controller.
TriggerHaptics Trigger a haptic event on supported controllers including Xbox trigger impulse rumble.
arrow_back_ios1arrow_forward_ios
trophy 345
Aug 2022 3 posts
Anthony 15 days ago edited 15 days ago
#1
arrow_back_ios1arrow_forward_ios
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.
  • News
  • About
  • Docs
  • FAQ
  • Forum
  • Discord
  • Twitter