diff --git a/qutebrowser/commands.py b/qutebrowser/commands.py index 54bb39aa6..e5c99b555 100644 --- a/qutebrowser/commands.py +++ b/qutebrowser/commands.py @@ -26,13 +26,13 @@ class CommandParser(QObject): class Command(QObject): nargs = 0 - name = '' + name = None key = None signal = None @classmethod def bind(cls): - if cls.name: + if cls.name is not None: cmd_dict[cls.name] = cls() def check(self, argv): @@ -46,6 +46,11 @@ class Command(QObject): raise NotImplementedError self.signal.emit() +class EmptyCmd(Command): + nargs = 0 + name = '' + key = ':' + class OpenCmd(Command): nargs = 1 name = 'open' diff --git a/qutebrowser/keys.py b/qutebrowser/keys.py index 37d60a360..1575afba6 100644 --- a/qutebrowser/keys.py +++ b/qutebrowser/keys.py @@ -9,6 +9,7 @@ class KeyParser(QObject): def from_cmd_dict(self, d, parent): for cmd in d.values(): if cmd.key is not None: + print('reg: {} -> {}'.format(cmd.name, cmd.key)) sc = QShortcut(parent) sc.setKey(QKeySequence(cmd.key)) sc.setContext(Qt.WidgetWithChildrenShortcut)