Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| scripting_function_keys [2021/08/23 11:45] – ↷ Page name changed from customize_hotkeys to scripting_function_keys atari | scripting_function_keys [2022/07/10 05:48] (current) – [Create a custom mapping] atari | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== What are hotkeys / multimedia keys ===== | + | ====== Scripting Function Keys ====== |
| - | You can map some keyboards button (or button of a board, or any specific button from a controller) | + | |
| - | to specific actions on your system, like muting the sound or shutting down. | + | |
| - | ===== What is the default mapping ===== | + | Many input devices nowadays include dedicated function keys for particular (usually hardware-related) functions, such as volume adjustment, brightness adjustment, power off, etc. Batocera supports |
| - | Default multimedia | + | |
| - | There are several files, depending on your board, but only one is used at once. | + | ===== Create a custom mapping ===== |
| - | It is generally multimedia_keys.conf, | + | To create a custom configuration that is overlaid |
| - | ===== Create my own mapping ===== | + | - Refer to the list of existing configurations at https:// |
| - | If you want to customize hotkeys, just create | + | If you'd like to see these files on your local installation: |
| + | - Connect to your Batocera machine either [[access_the_batocera_via_ssh|by SSH]] or by [[WinSCP]] (any method that lets you see the root of the system). | ||
| + | - Navigate to ''/ | ||
| + | </ | ||
| + | - Copy the file to ''/ | ||
| + | - Make your appropriate edits to it and save it. | ||
| - | | + | Your custom '' |
| - | It can be empty, but in this case, it will do nothing. | + | For example: |
| - | The best is to start for the current config and modifiying it. | + | |
| - | So, for example on odroid go super, to copy the current configuration and modify it, for example | + | <file bash multimedia_keys.conf> |
| + | BTN_TRIGGER_HAPPY3 1 batocera-brightness - 5 | ||
| + | BTN_TRIGGER_HAPPY4 1 batocera-brightness + 5 | ||
| + | KEY_MUTE 1 batocera-audio setSystemVolume mute-toggle | ||
| + | KEY_VOLUMEUP 1 batocera-audio setSystemVolume +5 | ||
| + | KEY_VOLUMEDOWN 1 batocera-audio setSystemVolume -5 | ||
| + | # power off, switch command | ||
| + | KEY_POWER | ||
| + | # display some information on X displays | ||
| + | KEY_F2 | ||
| + | </ | ||
| - | * copy / | + | You could also check for various hardware states, such as if there is a device plugged into the headphone jack: |
| - | * then modify | + | |
| - | KEY_POWER | + | <file bash multimedia_keys.conf> |
| + | SW_HEADPHONE_INSERT 0 | ||
| + | SW_HEADPHONE_INSERT | ||
| + | </ | ||
| - | by | + | Reboot the device to apply the new triggerhappy configuration. |
| - | KEY_POWER | + | ===== Identifying key names ===== |
| - | * reboot. | + | Open a terminal and type the following command: |
| - | ===== Find the mapping key name ===== | + | < |
| - | How to guess which value correspond to which button ? | + | evtest |
| + | </ | ||
| - | Easy. | + | Then select your intended controller and press the button on your controller. The detected input will then be displayed like so: |
| - | * Run in a terminal the command | + | < |
| + | Event: time 1614795871.549381, | ||
| + | </ | ||
| - | evtest | + | Look for the key name in parenthesis and its value when depressed after the " |
| - | * choose your controller | + | A list of most existing events can also be found in [[: |
| - | * press the button | + | |
| - | Event: time 1614795871.549381, | + | ===== What is the default mapping? ===== |
| - | * In this example, the button i pressed | + | All default configurations are at https:// |
- scripting_function_keys.1629719129.txt.gz
- Last modified: 5 years ago
- by atari