def init_keybinder(self, config): """Initialise keybinder and bind some keys (toggle, copy, paste)""" Keybinder.init() Keybinder.set_use_cooked_accelerators(False) self.bind_all_key(config['key_toggle_visibility'], config['key_copy_to_clipboard'], config['key_paste_from_clipboard'])
def __init__(self, superkey='<Super>'): self.montab = MonTab() self.super = superkey nmons = self.montab.screen.get_n_monitors() self.monkeys = [chr(ord('1') + n) for n in range(nmons)] Keybinder.init() Keybinder.set_use_cooked_accelerators(False)
def __init__(self): self.indicator = appindicator.Indicator.new(APPINDICATOR_ID, self.get_current_state_icon(), appindicator.IndicatorCategory.SYSTEM_SERVICES) self.indicator.set_status(appindicator.IndicatorStatus.ACTIVE) self.indicator.set_menu(self.build_menu()) self.update_mic_state() Notify.init(APPINDICATOR_ID) Keybinder.init() Keybinder.set_use_cooked_accelerators(False) Keybinder.bind(keystr, self.callback_toggle_mic, "keystring %s (user data)" % keystr) print ("Press '" + keystr + "' to toggle microphone mute")
from gi.repository import GdkX11 except ImportError: dbg("could not import X11 gir module") from . import util from .translation import _ from .version import APP_NAME from .container import Container from .factory import Factory from .terminator import Terminator if display_manager() == 'X11': try: gi.require_version('Keybinder', '3.0') from gi.repository import Keybinder Keybinder.init() Keybinder.set_use_cooked_accelerators(False) except (ImportError, ValueError): err('Unable to load Keybinder module. This means the \ hide_window shortcut will be unavailable') # pylint: disable-msg=R0904 class Window(Container, Gtk.Window): """Class implementing a top-level Terminator window""" terminator = None title = None isfullscreen = None ismaximised = None isDestroyed = False hidebound = None