2015-04-21, 02:50
EDIT: See updated documentation at http://forum.kodi.tv/showthread.php?tid=230276
The peripheral input system allows keyboards and game controllers to control Kodi, game add-ons, and button mapping utilities. The documentation is a series of procedures:
1. Scanning keyboards and joysticks
![Full sized picture Image](https://i.imgur.com/8H31mUL.png)
2. Mapping a button
![Full sized picture Image](https://i.imgur.com/heZMPR4.png)
3. Mapping a keyboard key
![Full sized picture Image](https://i.imgur.com/uiEMrSa.png)
4. Handling joystick event
Joystick events are mapped to virtual game controller (using button map data). Controller input is then:
* sent to a game add-on, or
* converted to an action and sent to Kodi
![Full sized picture Image](https://i.imgur.com/7Y7AszP.png)
5. Handling keyboard events
Keyboards are abstracted as joysticks with many buttons so that joystick input handlers can be re-used. Kodi input is handled elsewhere, so keyboard input is only sent to game add-ons.
![Full sized picture Image](https://i.imgur.com/9r2Ikfc.png)
The full system in all its glory
![Full sized picture Image](https://i.imgur.com/2o9yFsW.png)
EDIT: Split thread, updated diagrams
The peripheral input system allows keyboards and game controllers to control Kodi, game add-ons, and button mapping utilities. The documentation is a series of procedures:
1. Scanning keyboards and joysticks
![Full sized picture Image](https://i.imgur.com/8H31mUL.png)
2. Mapping a button
![Full sized picture Image](https://i.imgur.com/heZMPR4.png)
3. Mapping a keyboard key
![Full sized picture Image](https://i.imgur.com/uiEMrSa.png)
4. Handling joystick event
Joystick events are mapped to virtual game controller (using button map data). Controller input is then:
* sent to a game add-on, or
* converted to an action and sent to Kodi
![Full sized picture Image](https://i.imgur.com/7Y7AszP.png)
5. Handling keyboard events
Keyboards are abstracted as joysticks with many buttons so that joystick input handlers can be re-used. Kodi input is handled elsewhere, so keyboard input is only sent to game add-ons.
![Full sized picture Image](https://i.imgur.com/9r2Ikfc.png)
The full system in all its glory
![Full sized picture Image](https://i.imgur.com/2o9yFsW.png)
EDIT: Split thread, updated diagrams