diff --git a/src/cthulhu/cmdnames.py b/src/cthulhu/cmdnames.py index 66afd7a..f62959c 100644 --- a/src/cthulhu/cmdnames.py +++ b/src/cthulhu/cmdnames.py @@ -460,6 +460,9 @@ TOGGLE_SPEECH = _("Toggle the silencing of speech") # This string describes that command. TOGGLE_SPEECH_VERBOSITY = _("Toggle speech verbosity level") +# Translators: this string is associated with the keyboard shortcut to toggle sleepmode +TOGGLE_SLEEP_MODE = _("Toggle sleep mode") + # Translators: this string is associated with the keyboard shortcut to quit # Cthulhu. QUIT_CTHULHU = _("Quit the screen reader") diff --git a/src/cthulhu/common_keyboardmap.py b/src/cthulhu/common_keyboardmap.py index 400ae0a..d768a86 100644 --- a/src/cthulhu/common_keyboardmap.py +++ b/src/cthulhu/common_keyboardmap.py @@ -57,7 +57,7 @@ keymap = ( ("BackSpace", defaultModifierMask, CTHULHU_MODIFIER_MASK, "bypassNextCommandHandler"), - ("q", defaultModifierMask, CTHULHU_CTRL_ALT_MODIFIER_MASK | SHIFT_ALT_MODIFIER_MASK, + ("q", defaultModifierMask, CTHULHU_CTRL_ALT_MODIFIER_MASK | CTHULHU_SHIFT_MODIFIER_MASK, "toggleSleepModeHandler"), ("q", defaultModifierMask, CTHULHU_MODIFIER_MASK, diff --git a/src/cthulhu/scripts/default.py b/src/cthulhu/scripts/default.py index 5a19f7a..f0607bf 100644 --- a/src/cthulhu/scripts/default.py +++ b/src/cthulhu/scripts/default.py @@ -204,6 +204,11 @@ class Script(script.Script): Script.processBrailleCutLine, cmdnames.PROCESS_BRAILLE_CUT_LINE) + self.inputEventHandlers["toggleSleepModeHandler"] = \ + input_event.InputEventHandler( + Script.toggleSleepMode, + cmdnames.TOGGLE_SLEEP_MODE) + self.inputEventHandlers["shutdownHandler"] = \ input_event.InputEventHandler( cthulhu.quitCthulhu,