summaryrefslogtreecommitdiff
path: root/src/common.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-07-03 02:06:40 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-07-03 02:06:40 +0200
commita99257ad9a2b0dc6a1190e6ca87863a7ec1973ea (patch)
tree50d02dd2d74de01b03afa27eb3e0fa6e0d01a7ed /src/common.py
parent13f885fb74593b6c50174f9bbb7dd279fc344239 (diff)
downloadpoezio-a99257ad9a2b0dc6a1190e6ca87863a7ec1973ea.tar.gz
poezio-a99257ad9a2b0dc6a1190e6ca87863a7ec1973ea.tar.bz2
poezio-a99257ad9a2b0dc6a1190e6ca87863a7ec1973ea.tar.xz
poezio-a99257ad9a2b0dc6a1190e6ca87863a7ec1973ea.zip
Key bindings \o/
Diffstat (limited to 'src/common.py')
-rw-r--r--src/common.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common.py b/src/common.py
index 9435dab5..0bc93c8d 100644
--- a/src/common.py
+++ b/src/common.py
@@ -42,6 +42,8 @@ import curses
import time
import shlex
+from config import config
+
ROOM_STATE_NONE = 11
ROOM_STATE_CURRENT = 10
ROOM_STATE_PRIVATE = 15
@@ -211,3 +213,9 @@ def curses_color_pair(color):
if color < 0:
return curses.color_pair(-color) | curses.A_BOLD
return curses.color_pair(color)
+
+def replace_key_with_bound(key):
+ if config.has_option('bindings', key):
+ return config.get(key, key, 'bindings')
+ else:
+ return key