Skip to reading
GDScript Programming & Godot

SetInputDevice()

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page

Set Input Device

Select auto, mouse-keyboard, gamepad or touch input mode.

Source table from SetInputDevice(), page 191
Option key / fieldMeaning and inputDefault
Input Device deviceChoose: auto, mouse-keyboard, gamepad, touch."auto"

Timing. Waits for the runtime routine to return; no further completion wait is promised by this schema.

Code example
await SetInputDevice({"device": "auto"})

In use. Choose Auto for normal play or force Gamepad while testing controller prompts. Forcing a device is not a substitute for having usable bindings and an actual controller available.

SetProximityInteractionEnabled()#

Proximity Interaction

Enable or disable nearest/proximity-based interaction.

Source table from SetInputDevice(), page 191
Option key / fieldMeaning and inputDefault
Enabled enabledExplicit on/off state for the feature or response.true

Timing. Waits for the runtime routine to return; no further completion wait is promised by this schema.

Code example
await SetProximityInteractionEnabled({"enabled": true})

In use. Enable it for controller play in a small room. Check proximity radius, hotspot eligibility and line-of-play expectations so the nearest usable target is the one the player expects.

Page 191 of 378Permalink
Go to page