KeyboardShortcut

class glue.config.KeyboardShortcut[source]

Bases: glue.config.DictRegistry

Stores keyboard shortcuts. The members property is a dictionary within a dictionary of keyboard shortcuts, which is represented as (viewer,(keybind,function)). The function should take one item, which is a reference to the session.

Methods Summary

__call__(self, keybind, valid_viewers)

This is provided so that registry instances can be used as decorators.

add(self, valid_viewers, keybind, function)

Add a new keyboard shortcut

Methods Documentation

__call__(self, keybind, valid_viewers)[source]

This is provided so that registry instances can be used as decorators. The decorators should add the decorated code object to the registry, and return the original function

add(self, valid_viewers, keybind, function)[source]

Add a new keyboard shortcut

Parameters
arg1: list

list of viewers where event can be fired

arg2: Qt.Key

type of key event

arg3: function()

function to be run that corresponds with key