Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
scripting_function_keys [2021/11/30 07:17] – finish cleanup atariscripting_function_keys [2022/07/10 07:48] (current) – [Create a custom mapping] atari
Line 1: Line 1:
 ====== Scripting Function Keys ====== ====== Scripting Function Keys ======
  
-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 the scripting of these function keys to certain commands, and includes most common function keys for various platforms. But it is possible that your device in particular doesn't have these coded in yet, or you simply want to change what the function key does. This can be achieved via the configuration of [[#|triggerhappy]].+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 the scripting of any key to any command, and includes most common function keys for various platforms. But it is possible that your device in particular doesn't have these coded in yet, or you simply want to change what the function key does. This can be achieved via the configuration of triggerhappy.
  
 ===== Create a custom mapping ===== ===== Create a custom mapping =====
Line 22: Line 22:
 BTN_TRIGGER_HAPPY3 1            batocera-brightness - 5 BTN_TRIGGER_HAPPY3 1            batocera-brightness - 5
 BTN_TRIGGER_HAPPY4 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_VOLUMEUP 1                  batocera-audio setSystemVolume +5
 KEY_VOLUMEDOWN 1                batocera-audio setSystemVolume -5 KEY_VOLUMEDOWN 1                batocera-audio setSystemVolume -5
-# power off, switch command to `/usr/sbin/pm-suspendto go into suspend mode instead+# power off, switch command to "/usr/sbin/pm-suspendto go into suspend mode instead (suspend mode is currently unused in Batocera)
 KEY_POWER                     /sbin/shutdown -h now KEY_POWER                     /sbin/shutdown -h now
 # display some information on X displays # display some information on X displays
Line 54: Line 55:
  
 Look for the key name in parenthesis and its value when depressed after the "code" number. In this example, the key name would be ''KEY_SYSRQ'' and its value would be ''0''. Look for the key name in parenthesis and its value when depressed after the "code" number. In this example, the key name would be ''KEY_SYSRQ'' and its value would be ''0''.
 +
 +A list of most existing events can also be found in [[:evmapy#keys|the keys section of the evmapy page]].
  
 ===== What is the default mapping? ===== ===== What is the default mapping? =====
  • scripting_function_keys.1638253049.txt.gz
  • Last modified: 2 years ago
  • by atari