# cock.getBinded

Returns input devices binded to the map on the corresponding option.

## Function

### Synopsis

    device, key, inverse, delta, joystick = cock.getBinded ( self, map, option )

### Arguments

`table self`
  An object to use.
`string map`
  Control map to look up.
`string option`
  Optional. Map option to look up bindings in. Will revert to defaultOption if not provided.

### Returns

`number device`
  Input device number.
`number key`
  Input key value. May be a string, depending on the input device.
`number inverse`
  Inverse mode number.
`number delta`
  Delta mode number.
`number joystick`
  Internal joystick number. Will be 1 for non-joystick devices.

## Function

### Synopsis

    table= cock.getBinded ( self, map, all )

### Arguments

`table self`
  An object to use.
`string map`
  Control map to look up.
`boolean all`
  Value "true" will return a table with bindings on all options for the map.

### Returns

`table table`
  List of all binded controls for the map.

Table is generated as following:

    table={
        option = { "primary", "secondary", "etc."... },
        device = { 1, 2, 3... },
           key = { "x", 1, 5... },
       inverse = { 2, 1, -2... },
         delta = { 0, 1, -1... },
      joystick = { 1, 1, 3 }
    }

First sub-table contains option names in arbitrary order. Values in all other tables correspond to the options in the first table.

## See also

- cock.bind
- Common Organization of Controls Kit Input devices
- Common Organization of Controls Kit Input keys
- Common Organization of Controls Kit Modes
- Common Organization of Controls Kit Manual
- Common Organization of Controls Kit

Category:

- Functions