mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-14 10:48:36 +12:00
overlays/osk: Add more buttons to native dialog and other improvements
- Adds all the major buttons to native dialog input options - Adds more button options for the native osk - Brighten osk cell backgrounds a bit to improve visibility
This commit is contained in:
parent
9ed9d7e947
commit
c434e0ce27
4 changed files with 107 additions and 50 deletions
|
@ -5,36 +5,36 @@
|
|||
#include <locale>
|
||||
#include <codecvt>
|
||||
|
||||
#if _MSC_VER >= 1900
|
||||
// Stupid MSVC bug when T is set to char16_t
|
||||
std::string utf16_to_utf8(const std::u16string& utf16_string)
|
||||
{
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<int16_t>, int16_t> convert;
|
||||
auto p = reinterpret_cast<const int16_t *>(utf16_string.data());
|
||||
return convert.to_bytes(p, p + utf16_string.size());
|
||||
}
|
||||
|
||||
std::u16string utf8_to_utf16(const std::string& utf8_string)
|
||||
{
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<int16_t>, int16_t> convert;
|
||||
auto ws = convert.from_bytes(utf8_string);
|
||||
return reinterpret_cast<const char16_t*>(ws.c_str());
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
std::string utf16_to_utf8(const std::u16string& utf16_string)
|
||||
{
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert;
|
||||
return convert.to_bytes(utf16_string);
|
||||
}
|
||||
|
||||
std::u16string utf8_to_utf16(const std::string& utf8_string)
|
||||
{
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert;
|
||||
return convert.from_bytes(utf8_string);
|
||||
}
|
||||
|
||||
#if _MSC_VER >= 1900
|
||||
// Stupid MSVC bug when T is set to char16_t
|
||||
std::string utf16_to_utf8(const std::u16string& utf16_string)
|
||||
{
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<int16_t>, int16_t> convert;
|
||||
auto p = reinterpret_cast<const int16_t *>(utf16_string.data());
|
||||
return convert.to_bytes(p, p + utf16_string.size());
|
||||
}
|
||||
|
||||
std::u16string utf8_to_utf16(const std::string& utf8_string)
|
||||
{
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<int16_t>, int16_t> convert;
|
||||
auto ws = convert.from_bytes(utf8_string);
|
||||
return reinterpret_cast<const char16_t*>(ws.c_str());
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
std::string utf16_to_utf8(const std::u16string& utf16_string)
|
||||
{
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert;
|
||||
return convert.to_bytes(utf16_string);
|
||||
}
|
||||
|
||||
std::u16string utf8_to_utf16(const std::string& utf8_string)
|
||||
{
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert;
|
||||
return convert.from_bytes(utf8_string);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
namespace rsx
|
||||
|
@ -49,7 +49,7 @@ namespace rsx
|
|||
std::array<std::chrono::steady_clock::time_point, CELL_PAD_MAX_PORT_NUM> timestamp;
|
||||
timestamp.fill(std::chrono::steady_clock::now());
|
||||
|
||||
std::array<std::array<bool, 8>, CELL_PAD_MAX_PORT_NUM> button_state;
|
||||
std::array<std::array<bool, pad_button::pad_button_max_enum>, CELL_PAD_MAX_PORT_NUM> button_state;
|
||||
for (auto& state : button_state)
|
||||
{
|
||||
state.fill(true);
|
||||
|
@ -105,6 +105,12 @@ namespace rsx
|
|||
case CELL_PAD_CTRL_UP:
|
||||
button_id = pad_button::dpad_up;
|
||||
break;
|
||||
case CELL_PAD_CTRL_SELECT:
|
||||
button_id = pad_button::select;
|
||||
break;
|
||||
case CELL_PAD_CTRL_START:
|
||||
button_id = pad_button::start;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (button.m_offset == CELL_PAD_BTN_OFFSET_DIGITAL2)
|
||||
|
@ -123,6 +129,12 @@ namespace rsx
|
|||
case CELL_PAD_CTRL_CROSS:
|
||||
button_id = g_cfg.sys.enter_button_assignment == enter_button_assign::circle ? pad_button::circle : pad_button::cross;
|
||||
break;
|
||||
case CELL_PAD_CTRL_L1:
|
||||
button_id = pad_button::L1;
|
||||
break;
|
||||
case CELL_PAD_CTRL_R1:
|
||||
button_id = pad_button::R1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue