|
|
@ -115,7 +115,9 @@ static string get_unit_description(df::unit *unit)
|
|
|
|
return desc;
|
|
|
|
return desc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static bool cursor_key_pressed (std::set<df::interface_key> *input)
|
|
|
|
static bool cursor_key_pressed (std::set<df::interface_key> *input, bool in_entry_mode)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (in_entry_mode)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// give text input (e.g. "2") priority over cursor keys
|
|
|
|
// give text input (e.g. "2") priority over cursor keys
|
|
|
|
for (auto it = input->begin(); it != input->end(); ++it)
|
|
|
|
for (auto it = input->begin(); it != input->end(); ++it)
|
|
|
@ -123,6 +125,7 @@ static bool cursor_key_pressed (std::set<df::interface_key> *input)
|
|
|
|
if (Screen::keyToChar(*it) != -1)
|
|
|
|
if (Screen::keyToChar(*it) != -1)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return
|
|
|
|
return
|
|
|
|
input->count(df::interface_key::CURSOR_UP) ||
|
|
|
|
input->count(df::interface_key::CURSOR_UP) ||
|
|
|
|
input->count(df::interface_key::CURSOR_DOWN) ||
|
|
|
|
input->count(df::interface_key::CURSOR_DOWN) ||
|
|
|
@ -249,7 +252,7 @@ public:
|
|
|
|
// ENTER or ESC: leave typing mode
|
|
|
|
// ENTER or ESC: leave typing mode
|
|
|
|
end_entry_mode();
|
|
|
|
end_entry_mode();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (cursor_key_pressed(input))
|
|
|
|
else if (cursor_key_pressed(input, entry_mode))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Arrow key pressed. Leave entry mode and allow screen to process key
|
|
|
|
// Arrow key pressed. Leave entry mode and allow screen to process key
|
|
|
|
end_entry_mode();
|
|
|
|
end_entry_mode();
|
|
|
@ -1953,7 +1956,7 @@ public:
|
|
|
|
end_entry_mode();
|
|
|
|
end_entry_mode();
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (cursor_key_pressed(input))
|
|
|
|
if (cursor_key_pressed(input, in_entry_mode()))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
end_entry_mode();
|
|
|
|
end_entry_mode();
|
|
|
|
clear_search();
|
|
|
|
clear_search();
|
|
|
|