diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-07-03 02:24:56 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-07-03 02:24:56 +0200 |
commit | 606360e07c8a2d59971fff3bea66b539c5ede084 (patch) | |
tree | f5823bb93c50dc26a66dc69cde9f0ec6f0f110a5 /src/core.py | |
parent | a99257ad9a2b0dc6a1190e6ca87863a7ec1973ea (diff) | |
download | poezio-606360e07c8a2d59971fff3bea66b539c5ede084.tar.gz poezio-606360e07c8a2d59971fff3bea66b539c5ede084.tar.bz2 poezio-606360e07c8a2d59971fff3bea66b539c5ede084.tar.xz poezio-606360e07c8a2d59971fff3bea66b539c5ede084.zip |
/bind command
Diffstat (limited to 'src/core.py')
-rw-r--r-- | src/core.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core.py b/src/core.py index 671834e4..1c596bc0 100644 --- a/src/core.py +++ b/src/core.py @@ -129,6 +129,7 @@ class Core(object): 'version': (self.command_version, _('Usage: /version <jid>\nVersion: get the software version of the given JID (usually its XMPP client and Operating System)'), None), 'connect': (self.command_reconnect, _('Usage: /connect\nConnect: disconnect from the remote server if you are currently connected and then connect to it again'), None), 'server_cycle': (self.command_server_cycle, _('Usage: /server_cycle [domain] [message]\nServer Cycle: disconnect and reconnects in all the rooms in domain.'), None), + 'bind': (self.command_bind, _('Usage: /bind <key> <equ>\nBind: bind a key to an other key or to a “command”. For example "/bind ^H KEY_UP" makes Control + h do the same same than the Up key.')), } self.key_func = { @@ -1379,6 +1380,16 @@ class Core(object): tab.get_room().joined = False self.command_join(tab.get_name()) + def command_bind(self, arg): + """ + Bind a key. + """ + args = common.shell_split(arg) + if len(args) != 2: + return self.command_help('bind') + config.set_and_save(args[0], args[1], section='bindings') + self.information('%s is now bound to %s' % (args[0], args[1]), 'Info') + def go_to_room_number(self): """ Read 2 more chars and go to the tab |