Fixed minor issues.

This commit is contained in:
rakshasa
2019-06-09 17:09:35 +09:00
parent 35d98c91e0
commit a3a384b049
9 changed files with 283 additions and 30 deletions
+12 -2
View File
@@ -274,21 +274,31 @@ DownloadList::receive_view_input(Input type) {
std::placeholders::_1,
std::placeholders::_2));
// reset ESC delay for input prompt
set_escdelay(0);
input->bindings()['\n'] = std::bind(&DownloadList::receive_exit_input, this, type);
input->bindings()[KEY_ENTER] = std::bind(&DownloadList::receive_exit_input, this, type);
input->bindings()['\x07'] = std::bind(&DownloadList::receive_exit_input, this, INPUT_NONE);
input->bindings()['\x07'] = std::bind(&DownloadList::receive_exit_input, this, INPUT_NONE); // ^G
input->bindings()['\x1B'] = std::bind(&DownloadList::receive_exit_input, this, INPUT_NONE); // ESC , ^[
control->ui()->enable_input(title, input);
control->ui()->enable_input(title, input, type);
}
void
DownloadList::receive_exit_input(Input type) {
// set back ESC delay to default
set_escdelay(1000);
input::TextInput* input = control->ui()->current_input();
// We should check that this object is the one holding the input.
if (input == NULL)
return;
if (type != INPUT_NONE && type != INPUT_EOI)
control->ui()->add_to_input_history(type, input->str());
control->ui()->disable_input();
try {