summaryrefslogtreecommitdiff
path: root/manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'manager.cpp')
-rw-r--r--manager.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/manager.cpp b/manager.cpp
index 7f9fa89..951d84b 100644
--- a/manager.cpp
+++ b/manager.cpp
@@ -137,11 +137,14 @@ int Manager::io(){
int key=tgetkey();
- auto it=global_keybindings.find(key);
- if(it!=global_keybindings.end()){
- receive(it->second);
+ Either<bool,Command> ret=global_keyinput.input(key);
+ if(ret.isLeft()){
+ if(!ret.fromLeft()){
+ bel();
+ receive({"error","Unbound key sequence"});
+ }
} else {
- receive({"error","Unbound key: "+to_string(key)});
+ receive(ret.fromRight());
}
if(should_quit)break;
}