add support for binding actions to multibyte characters

This commit is contained in:
Andrzej Rybczak
2012-08-25 01:32:12 +02:00
parent 3750533026
commit 6829a8e05c
10 changed files with 289 additions and 213 deletions

View File

@@ -103,7 +103,7 @@ int main(int argc, char **argv)
Config.Read();
Config.GenerateColumns();
Key.GenerateKeybindings();
Keys.GenerateBindings();
if (getenv("MPD_HOST"))
Mpd.SetHostname(getenv("MPD_HOST"));
@@ -175,8 +175,7 @@ int main(int argc, char **argv)
Mpd.SetErrorHandler(NcmpcppErrorCallback, 0);
// local variables
int input = 0;
Action::Key input(Action::NoOp);
timeval past = { 0, 0 };
// local variables end
@@ -263,14 +262,14 @@ int main(int argc, char **argv)
}
// header stuff end
if (input != ERR)
if (input != Action::NoOp)
myScreen->RefreshWindow();
wFooter->ReadKey(input);
input = Action::ReadKey(*wFooter);
if (input == ERR)
if (input == Action::NoOp)
continue;
NcmpcppKeys::Binding k = Key.Bindings.equal_range(input);
KeyConfiguration::Binding k = Keys.Bindings.equal_range(input);
for (; k.first != k.second; ++k.first)
if (k.first->second->Execute())
break;