User Tools

Site Tools


guide:event_binding
You were redirected here from guide:event_bindings.

Event bindings

Event bindings map input events to console commands.

Syntax

bindevent [ context ] spec command

The event specification spec is composed of an event descriptor and optionally any additional conditions for the validity of the binding. The specification may be prefixed with a context name; if omitted, the binding is created in the default “game” context.

Examples

bindevent key-codex20-up "print {space (0x20) released}"
bindevent key-m-down+key-shift+key-ctrl "print {Shift+Ctrl+M}"
bindevent key-capslock-down "toggle ctl-run"
bindevent key-home-down "impulse falldown"
bindevent key-equals-down {add view-size 1}
bindevent key-equals-repeat {add view-size 1}
bindevent key-t+multiplayer beginchat
bindevent game:key-m-press "print {M pressed in game context}"
bindevent chat:key-f2 {chatsendmacro 1}
bindevent map:key-c {impulse clearmarks}
bindevent shortcut:key-f8 {toggle msg-show}
bindevent mouse-left "print {left mouse button pressed}"
bindevent mouse-right-up "print {right mouse button released}"
bindevent "joy-x-neg1.0 + key-ctrl-up" "print {joy X negative without Ctrl}"
bindevent joy-x-within0.1 "print {joy X centered}"
bindevent joy-x-pos1.0 "print {joy X positive}"
bindevent joy-hat-angle3 "print {angle 3}"
bindevent joy-hat-center "print center"

See also

guide/event_binding.txt · Last modified: 2019-11-17 16:08 by skyjake