overlays: implement osk keyboard cursor actions

This commit is contained in:
Megamouse 2022-10-29 22:28:21 +02:00
parent eccceea7fb
commit 059c45f202
2 changed files with 19 additions and 0 deletions

View File

@ -706,6 +706,18 @@ namespace rsx
case CELL_KEYC_ESCAPE:
Close(CELL_OSKDIALOG_CLOSE_CANCEL);
break;
case CELL_KEYC_RIGHT_ARROW:
on_move_cursor(key, edit_text::direction::right);
break;
case CELL_KEYC_LEFT_ARROW:
on_move_cursor(key, edit_text::direction::left);
break;
case CELL_KEYC_DOWN_ARROW:
on_move_cursor(key, edit_text::direction::down);
break;
case CELL_KEYC_UP_ARROW:
on_move_cursor(key, edit_text::direction::up);
break;
case CELL_KEYC_ENTER:
if ((flags & CELL_OSKDIALOG_NO_RETURN))
{
@ -833,6 +845,12 @@ namespace rsx
}
}
void osk_dialog::on_move_cursor(const std::u32string&, edit_text::direction dir)
{
m_preview.move_caret(dir);
m_update = true;
}
std::u32string osk_dialog::get_placeholder() const
{
const localized_string_id id = m_password_mode

View File

@ -106,6 +106,7 @@ namespace rsx
void on_backspace(const std::u32string&);
void on_delete(const std::u32string&);
void on_enter(const std::u32string&);
void on_move_cursor(const std::u32string&, edit_text::direction dir);
std::u32string get_placeholder() const;