From af47bdf91ebe127e2d2384ec0afd49d617881d49 Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Wed, 25 Feb 2009 12:17:53 +0000 Subject: Use keyboard specific keys to set the volume #430 We listen now like GNOME for 'XF86AudioMute', 'XF86AudioLowerVolume' and 'XF86AudioRaiseVolume' --- (limited to 'src/jarabe') diff --git a/src/jarabe/view/keyhandler.py b/src/jarabe/view/keyhandler.py index 98e5b13..fb02d7b 100644 --- a/src/jarabe/view/keyhandler.py +++ b/src/jarabe/view/keyhandler.py @@ -1,4 +1,5 @@ # Copyright (C) 2006-2007, Red Hat, Inc. +# Copyright (C) 2009 Simon Schampijer # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -42,30 +43,33 @@ _VOLUME_MAX = 100 _TABBING_MODIFIER = gtk.gdk.MOD1_MASK _actions_table = { - 'F1' : 'zoom_mesh', - 'F2' : 'zoom_group', - 'F3' : 'zoom_home', - 'F4' : 'zoom_activity', - 'F9' : 'brightness_down', - 'F10' : 'brightness_up', - 'F9' : 'brightness_min', - 'F10' : 'brightness_max', - 'F11' : 'volume_down', - 'F12' : 'volume_up', - 'F11' : 'volume_min', - 'F12' : 'volume_max', - '0x93' : 'frame', - '0xEB' : 'rotate', - 'Tab' : 'next_window', - 'Tab': 'previous_window', - 'Escape' : 'close_window', - '0xDC' : 'open_search', + 'F1' : 'zoom_mesh', + 'F2' : 'zoom_group', + 'F3' : 'zoom_home', + 'F4' : 'zoom_activity', + 'F9' : 'brightness_down', + 'F10' : 'brightness_up', + 'F9' : 'brightness_min', + 'F10' : 'brightness_max', + 'XF86AudioMute' : 'volume_mute', + 'F11' : 'volume_down', + 'XF86AudioLowerVolume' : 'volume_down', + 'F12' : 'volume_up', + 'XF86AudioRaiseVolume' : 'volume_down', + 'F11' : 'volume_min', + 'F12' : 'volume_max', + '0x93' : 'frame', + '0xEB' : 'rotate', + 'Tab' : 'next_window', + 'Tab' : 'previous_window', + 'Escape' : 'close_window', + '0xDC' : 'open_search', # the following are intended for emulator users - 'f' : 'frame', - 'q' : 'quit_emulator', - 'o' : 'open_search', - 'r' : 'rotate', - 's' : 'say_text', + 'f' : 'frame', + 'q' : 'quit_emulator', + 'o' : 'open_search', + 'r' : 'rotate', + 's' : 'say_text', } SPEECH_DBUS_SERVICE = 'org.laptop.Speech' @@ -196,6 +200,9 @@ class KeyHandler(object): def handle_brightness_down(self): self._change_brightness(step=-_BRIGHTNESS_STEP) + def handle_volume_mute(self): + self._change_volume(value=0) + def handle_volume_up(self): self._change_volume(step=_VOLUME_STEP) -- cgit v0.9.1