From 122af8eacd991eef1eb06c8eb35f962d34672084 Mon Sep 17 00:00:00 2001 From: chrys Date: Sun, 3 Feb 2019 22:48:43 +0100 Subject: [PATCH] add and bind toggle --- config/keyboard/desktop.conf | 1 + config/keyboard/laptop.conf | 1 + .../commands/commands/toggle_vmenu_mode.py | 23 +++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 src/fenrirscreenreader/commands/commands/toggle_vmenu_mode.py diff --git a/config/keyboard/desktop.conf b/config/keyboard/desktop.conf index b6781036..c7e0a279 100644 --- a/config/keyboard/desktop.conf +++ b/config/keyboard/desktop.conf @@ -115,6 +115,7 @@ KEY_FENRIR,KEY_F6=export_clipboard_to_file KEY_FENRIR,KEY_CTRL,KEY_SHIFT,KEY_X=remove_marks KEY_FENRIR,KEY_X=set_mark KEY_FENRIR,KEY_SHIFT,KEY_X=marked_text +KEY_FENRIR,KEY_F10=toggle_vmenu_mode # linux specific KEY_FENRIR,KEY_F7=import_clipboard_from_x KEY_FENRIR,KEY_F8=export_clipboard_to_x diff --git a/config/keyboard/laptop.conf b/config/keyboard/laptop.conf index 53626b1d..57bc2210 100644 --- a/config/keyboard/laptop.conf +++ b/config/keyboard/laptop.conf @@ -115,6 +115,7 @@ KEY_FENRIR,KEY_F6=export_clipboard_to_file KEY_FENRIR,KEY_CTRL,KEY_SHIFT,KEY_X=remove_marks KEY_FENRIR,KEY_X=set_mark KEY_FENRIR,KEY_SHIFT,KEY_X=marked_text +KEY_FENRIR,KEY_F10=toggle_vmenu_mode # linux specific KEY_FENRIR,KEY_F7=import_clipboard_from_x KEY_FENRIR,KEY_F8=export_clipboard_to_x diff --git a/src/fenrirscreenreader/commands/commands/toggle_vmenu_mode.py b/src/fenrirscreenreader/commands/commands/toggle_vmenu_mode.py new file mode 100644 index 00000000..d8b62d5f --- /dev/null +++ b/src/fenrirscreenreader/commands/commands/toggle_vmenu_mode.py @@ -0,0 +1,23 @@ +#!/bin/python +# -*- coding: utf-8 -*- + +# Fenrir TTY screen reader +# By Chrys, Storm Dragon, and contributers. + +from fenrirscreenreader.core import debug + +class command(): + def __init__(self): + pass + def initialize(self, environment): + self.env = environment + def shutdown(self): + pass + def getDescription(self): + self.env['runtime']['vmenuManager'].togglelVMenuMode() + return _('Exiting v menu mode.') + def run(self): + self.env['runtime']['vmenuManager'].togglelVMenuMode() + self.env['runtime']['outputManager'].presentText( _('Entering v menu.'), interrupt=True) + def setCallback(self, callback): + pass