Skip to content
Alex Lementuev edited this page Jul 23, 2015 · 8 revisions

Hotkeys Binding

Lunar Plugin supports key binding - assigning hot keys to commands and commands chains.
Note: Only works in the Game View and Scene View.

Binding A Key

Usage:

bind <shortcut> [<command>]

Example:

> bind v cvarlist

Focus Scene View and press v:

  c_bool 0
  c_float 10
  c_int 10
  c_string "Some string"
  c_vector2 "0 0"
  c_vector3 "0 0 0"
  c_vector4 "0 0 0 0"

List of supported keys

-            delete       j            kp_period    numlock
,            down         joy0         kp_plus      o
.            e            joy1         l            p
/            end          joy10        left         pagedown
;            enter        joy11        leftalt      pageup
[            escape       joy12        leftcmd      pause
\            f            joy13        leftctrl     print
]            f1           joy14        leftshift    q
~            f10          joy15        m            r
=            f11          joy16        mouse0       right
0            f12          joy17        mouse1       rightalt
1            f13          joy18        mouse2       rightcmd
2            f14          joy19        mouse3       rightctrl
3            f15          joy2         mouse4       rightshift
4            f2           joy3         mouse5       s
5            f3           joy4         mouse6       scrolllock
6            f4           joy5         n            space
7            f5           joy6         num0         t
8            f6           joy7         num1         tab
9            f7           joy8         num2         u
a            f8           joy9         num3         up
b            f9           k            num4         v
backspace    g            kp_divide    num5         w
break        h            kp_enter     num6         x
c            home         kp_equals    num7         y
capslock     i            kp_minus     num8         z
d            insert       kp_multiply  num9

Checking Current Key Binding

> bind v
  bind v cvarlist

Checking All Keys Binding

> bindlist
  bind v cvarlist

Removing Current Key Binding

> unbind v

Removing All Bindings

> unbindAll

Binding To A Short Cut

> bind ctrl+t "echo 'test'"
> bind ctrl+shift+t "echo 'test'"
> bind cmd+shift+t "echo 'test'"
> bind ctrl+alt+t "echo 'test'"

Binding To A Boolean Config Variable

Set boolVar to true when right mouse button is down and set back to false when button is up:

> bind mouse1 +boolVar

Set boolVar to false when right mouse button is down and set back to true when button is up:

> bind mouse1 -boolVar