# getFunctionsBoundToKey (Shared)

> Lists the functions this resource bound to a key.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Keyboard
- **URL**: https://wiki.mymp.gg/en/getFunctionsBoundToKey

## Syntax

```lua
table getFunctionsBoundToKey(player thePlayer, string key)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `thePlayer` | `player` | Server only: the player the bind belongs to. On the client, leave this argument out. |
| `key` | `string` | The 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

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

## See also

- [bindKey (Shared)](https://wiki.mymp.gg/en/bindKey.md): Binds a key to a function or a command. The function runs when the key is pressed, released or both.
- [getKeyBoundToFunction (Shared)](https://wiki.mymp.gg/en/getKeyBoundToFunction.md): Tells which key this resource bound a function to.
- [isKeyBound (Shared)](https://wiki.mymp.gg/en/isKeyBound.md): Tells whether this resource bound a function to a key.
