From 272cc2c2bce157d1fc57e6099a85e749ef76d674 Mon Sep 17 00:00:00 2001 From: Nathaniel Date: Fri, 9 Nov 2018 18:34:38 -0800 Subject: [PATCH] Prepend 'XF86' where needed for audio/backlight When clicking in the 'Key' region for a binding it prompts you to enter a new accelerator, entering any dedicated key for audio or backlight will give you `AudioRaiseVolume`, `MonBrightness`, so on and so forth. If you have dedicated volume or backlight keys then the bound keys need to be `XF86AudioRaiseVolume`, `XF86AudioLowerVolume`, `XF86MonBrightnessUp`, `XF86MonBrightnessDown`, etc.. Please correct me if I am wrong. The key is returned by `key_gtk2openbox()`, this patch simply prepends `XF86` when the key name has 'Audio' or 'MonBrightness' in it. I'm sure there could be a more fancy way of doing this however this works and I don't believe it will have any collisions with other mappings/keys. Cheers --- obkey_classes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/obkey_classes.py b/obkey_classes.py index 3b645eb..c864d82 100755 --- a/obkey_classes.py +++ b/obkey_classes.py @@ -114,6 +114,8 @@ def key_gtk2openbox(key, mods): k = Gtk.accelerator_name(key, 0) if result != "": result += '-' + if 'Audio' in k or 'MonBrightness' in k: + k = 'XF86' + k result += k return result