User Tools

Site Tools


guide:event_binding

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
guide:event_binding [2017-03-21 07:03] skyjakeguide:event_binding [2019-11-17 16:08] (current) skyjake
Line 1: Line 1:
 +====== Event bindings ======
 +
 +
 +Event bindings map input events to console commands.
 +
 +
 +===== Syntax =====
 +
 +#@Identifier_HTML~bindevent~@# [ #@UArg_HTML~context~@# ] #@UArg_HTML~spec~@# #@UArg_HTML~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 =====
 +
 +<code>
 +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}
 +</code>
 +<code>
 +bindevent mouse-left "print {left mouse button pressed}"
 +bindevent mouse-right-up "print {right mouse button released}"
 +</code>
 +<code>
 +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"
 +</code>
 +
 +
 +===== See also =====
 +
 +  *  [[Bindings]]
 +  *  Console command ''bindevent''
 +
 +
  
guide/event_binding.txt · Last modified: 2019-11-17 16:08 by skyjake