client_input
Control a Garry's Mod client: movement, aiming, key presses, Derma clicks, text input, and chat. Switch between world and UI input modes.
Instructions
Drives the connected GMod client: movement, aim, keys, Derma clicks, typing, chat. Modal -- 'world' drives movement through CreateMove, 'ui' hands input to the panel system, and the two are mutually exclusive; the action switches mode for you. Durations are SECONDS (CreateMove runs at the client's cmdrate, so tick counts are not a duration), clamped to 5s, and everything resets after 30s or on gmod_mcp_release in the client console. To fill a form use set_text (targets a field by name and fires its change notification); type sends real keystrokes and needs a target or an already-focused field. click takes a NAMED target as well as x/y and is self-sufficient -- it moves the cursor, waits for hover to settle, presses and releases, so no move_cursor is needed first. Follow with read_view or read_panel_text to see the effect.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | click/move_cursor: screen X. Ignored when a named target is given. | |
| y | No | click/move_cursor: screen Y. Ignored when a named target is given. | |
| up | No | move: vertical speed (swimming, ladders). | |
| key | No | press/release: IN_ bit (IN_ATTACK 1, IN_JUMP 2, IN_DUCK 4, IN_FORWARD 8, IN_BACK 16, IN_USE 32, IN_MOVELEFT 512, IN_MOVERIGHT 1024, IN_ATTACK2 2048, IN_RELOAD 8192, IN_SPEED 131072). key_ui: a KEY_ enum instead. | |
| pos | No | look_at: world position to aim at. | |
| yaw | No | look: yaw. | |
| mode | No | mode: which input mode to switch to. | |
| name | No | click/type/set_text: target the panel with this registered vgui name (R_UI_Button, DTextEntry). Not the class -- a kit panel's class is its VGUI base. | |
| side | No | move: strafe speed. | |
| text | No | set_text: the value to put in the field. type: characters to send. say: chat message. | |
| class | No | click/type/set_text: target by VGUI base class (Label, TextEntry, Panel). | |
| delta | No | scroll: wheel delta. | |
| enter | No | set_text: also fire the field's OnEnter, for forms that only validate or submit on Enter. Off by default -- on a chat entry it sends the line. | |
| focus | No | set_text: default true, calls RequestFocus first so the field's own focus logic runs. | |
| index | No | click/type/set_text: which match to act on when several qualify. | |
| pitch | No | look: pitch, clamped to +-89. | |
| action | Yes | ||
| button | No | click: which mouse button. | |
| weapon | No | select_weapon: weapon class the player is carrying. | |
| forward | No | move: forward speed, negative for backward. | |
| contains | No | click/type/set_text: narrow the target to panels whose displayed text contains this (case-insensitive). | |
| duration | No | Seconds to hold a key, a movement or a scripted aim. Clamped to 5. | |
| onScreen | No | click/type/set_text: default true, only panels whose whole ancestry is visible. false reaches hidden ones. |