M MY Multiplayer: Wiki
Side
Kind

getFunctionsBoundToKey

Shared

Lists the functions this resource bound to a key.

table getFunctionsBoundToKey(player thePlayer, string key)

Parameters

NameTypeDescription
thePlayerplayerServer only: the player the bind belongs to. On the client, leave this argument out.
keystringThe key's name, in any case: a to z, 0 to 9, F1 to F12, mouse1 to mouse5, mouse_wheel_up, mouse_wheel_down, arrow_l, num_0, space, enter, lshift and others.

Returns

A table with the functions, without repeats, bound on press or release. It is empty if there are none.

Example

for _, handler in ipairs(getFunctionsBoundToKey("f")) do
    unbindKey("f", "both", handler)
end

See also