Try to fix sleep mode so it is actually detected.

This commit is contained in:
Storm Dragon 2024-12-22 14:49:31 -05:00
parent 1c9ca14272
commit ba735c554b
3 changed files with 9 additions and 1 deletions

View File

@ -460,6 +460,9 @@ TOGGLE_SPEECH = _("Toggle the silencing of speech")
# This string describes that command. # This string describes that command.
TOGGLE_SPEECH_VERBOSITY = _("Toggle speech verbosity level") 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 # Translators: this string is associated with the keyboard shortcut to quit
# Cthulhu. # Cthulhu.
QUIT_CTHULHU = _("Quit the screen reader") QUIT_CTHULHU = _("Quit the screen reader")

View File

@ -57,7 +57,7 @@ keymap = (
("BackSpace", defaultModifierMask, CTHULHU_MODIFIER_MASK, ("BackSpace", defaultModifierMask, CTHULHU_MODIFIER_MASK,
"bypassNextCommandHandler"), "bypassNextCommandHandler"),
("q", defaultModifierMask, CTHULHU_CTRL_ALT_MODIFIER_MASK | SHIFT_ALT_MODIFIER_MASK, ("q", defaultModifierMask, CTHULHU_CTRL_ALT_MODIFIER_MASK | CTHULHU_SHIFT_MODIFIER_MASK,
"toggleSleepModeHandler"), "toggleSleepModeHandler"),
("q", defaultModifierMask, CTHULHU_MODIFIER_MASK, ("q", defaultModifierMask, CTHULHU_MODIFIER_MASK,

View File

@ -204,6 +204,11 @@ class Script(script.Script):
Script.processBrailleCutLine, Script.processBrailleCutLine,
cmdnames.PROCESS_BRAILLE_CUT_LINE) cmdnames.PROCESS_BRAILLE_CUT_LINE)
self.inputEventHandlers["toggleSleepModeHandler"] = \
input_event.InputEventHandler(
Script.toggleSleepMode,
cmdnames.TOGGLE_SLEEP_MODE)
self.inputEventHandlers["shutdownHandler"] = \ self.inputEventHandlers["shutdownHandler"] = \
input_event.InputEventHandler( input_event.InputEventHandler(
cthulhu.quitCthulhu, cthulhu.quitCthulhu,