summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-07-03 02:24:56 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-07-03 02:24:56 +0200
commit606360e07c8a2d59971fff3bea66b539c5ede084 (patch)
treef5823bb93c50dc26a66dc69cde9f0ec6f0f110a5
parenta99257ad9a2b0dc6a1190e6ca87863a7ec1973ea (diff)
downloadpoezio-606360e07c8a2d59971fff3bea66b539c5ede084.tar.gz
poezio-606360e07c8a2d59971fff3bea66b539c5ede084.tar.bz2
poezio-606360e07c8a2d59971fff3bea66b539c5ede084.tar.xz
poezio-606360e07c8a2d59971fff3bea66b539c5ede084.zip
/bind command
-rw-r--r--src/core.py11
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