Key binds that Flux handles itself, independently of the binds in the settings of the game. A bind ties a button (a KEY_ or MOUSE_ code) to a console command. Plugins add their default binds on the client with Flux.Binds:add_bind, for example Flux.Binds:add_bind('ToggleThirdPerson', 'fl_third_person', KEY_P). When a player presses a button, the server tells their client which one, and the client runs the console command that is bound to it, if any. A command can only be bound to one button at a time. The library itself only exists on the client.

Summary

Methods

Adds a default key bind for a console command.
all()client
Returns all of the Flux key binds.
Returns the console command bound to the specified button with Flux binds.
Returns the buttons that have something bound to them in the game's own settings.
Returns the names of all of the keyboard and mouse button enumerations.
Returns the buttons whose binding in the game's own settings is a number rather than a command.
Binds a console command to the specified button, removing its previous bind.

Methods

Flux.Binds:add_bind(_id, command, key)

client packages/flow/lib/sh_binds.lua:98

Adds a default key bind for a console command.

Flux.Binds:add_bind('ToggleThirdPerson', 'fl_third_person', KEY_P)

Parameters

  • _id String name of the bind, unused
  • command String console command to run when the button is pressed
  • key Number button code, see the KEY and MOUSE enumerations

Flux.Binds:all()

client packages/flow/lib/sh_binds.lua:34

Returns all of the Flux key binds.

Returns

  • Map console commands by button code

Flux.Binds:get_bind(key)

client packages/flow/lib/sh_binds.lua:74

Returns the console command bound to the specified button with Flux binds.

Parameters

  • key Number button code, see the KEY and MOUSE enumerations

Returns

  • String console command, or nil if nothing is bound

Flux.Binds:get_bound()

client packages/flow/lib/sh_binds.lua:40

Returns the buttons that have something bound to them in the game's own settings.

Returns

  • Map engine bindings (String) by button code

Flux.Binds:get_enums()

client packages/flow/lib/sh_binds.lua:28

Returns the names of all of the keyboard and mouse button enumerations.

Returns

  • Map enumeration names (such as 'KEY_N') by button code

Flux.Binds:get_unbound()

client packages/flow/lib/sh_binds.lua:57

Returns the buttons whose binding in the game's own settings is a number rather than a command.

Returns

  • Map engine bindings by button code

Flux.Binds:set_bind(command, key)

client packages/flow/lib/sh_binds.lua:81

Binds a console command to the specified button, removing its previous bind.

Parameters

  • command String console command to run when the button is pressed
  • key Number button code, see the KEY and MOUSE enumerations

Defined in