mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-20 11:35:45 +00:00
Added accent letters layouts for english (from PS5)
This commit is contained in:
parent
2ac099264d
commit
22145d2b0a
3 changed files with 211 additions and 105 deletions
|
@ -20,7 +20,7 @@ constexpr auto Square = ImGuiNavInput_Cancel;
|
|||
constexpr auto Triangle = ImGuiNavInput_Input;
|
||||
constexpr auto TouchPad = ImGuiNavInput_Menu; // reuse if needed
|
||||
|
||||
const std::vector<Key> kUppercaseLayout = {
|
||||
const std::vector<Key> kLayoutEnLettersUppercase = {
|
||||
// Row 1
|
||||
{0, 0, 1, 1, "1", "", KeyType::Text, {}},
|
||||
{0, 1, 1, 1, "2", "", KeyType::Text, {}},
|
||||
|
@ -71,9 +71,8 @@ const std::vector<Key> kUppercaseLayout = {
|
|||
|
||||
// Row 5
|
||||
{4, 0, 1, 1, "⬆", "L2", KeyType::Shift, {L2}},
|
||||
|
||||
{4, 1, 1, 1, "@#:", "L2+△", KeyType::Symbols1Layout, {L3, Triangle}},
|
||||
{4, 2, 1, 1, "à", "L3", KeyType::UnknownFunction, {L3}},
|
||||
{4, 2, 1, 1, "à", "L3", KeyType::AccentLettersLayout, {L3}},
|
||||
{4, 3, 4, 1, "Space", "△", KeyType::Space, {Triangle}},
|
||||
//{4, 4, 4, 1, "Space", "△", KeyType::Space,{Triangle}},
|
||||
//{4, 5, 4, 1, "Space", "△", KeyType::Space,{Triangle}},
|
||||
|
@ -88,16 +87,14 @@ const std::vector<Key> kUppercaseLayout = {
|
|||
{5, 2, 1, 1, "◀", "L1", KeyType::CursorLeft, {L1}},
|
||||
{5, 3, 1, 1, "▶", "R1", KeyType::CursorRight, {R1}},
|
||||
{5, 4, 1, 1, "KB", "", KeyType::ToggleKeyboard, {}},
|
||||
//{5, 4, 1, 1, "⌨", "", KeyType::ToggleKeyboard,{}},
|
||||
{5, 5, 1, 1, "...", "", KeyType::MoreOptions, {}},
|
||||
//{5, 5, 1, 1, "…", "", KeyType::MoreOptions,{}},
|
||||
{5, 6, 1, 1, "+/⊗", "R3", KeyType::ControllerAction, {R3}},
|
||||
{5, 7, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{5, 8, 2, 1, "Done", "R2", KeyType::Done, {R2}},
|
||||
//{5, 9, 2, 1, "Done", "R2", KeyType::Done,{R2}},
|
||||
};
|
||||
|
||||
const std::vector<Key> kLowercaseLayout = {
|
||||
const std::vector<Key> kLayoutEnLettersLowercase = {
|
||||
// Row 1
|
||||
{0, 0, 1, 1, "1", "", KeyType::Text, {}},
|
||||
{0, 1, 1, 1, "2", "", KeyType::Text, {}},
|
||||
|
@ -149,7 +146,7 @@ const std::vector<Key> kLowercaseLayout = {
|
|||
// Row 5
|
||||
{4, 0, 1, 1, "⇧", "L2", KeyType::Shift, {L2}},
|
||||
{4, 1, 1, 1, "@#:", "L2+△", KeyType::Symbols1Layout, {L2, Triangle}},
|
||||
{4, 2, 1, 1, "à", "L3", KeyType::UnknownFunction, {L3}},
|
||||
{4, 2, 1, 1, "à", "L3", KeyType::AccentLettersLayout, {L3}},
|
||||
{4, 3, 4, 1, "Space", "△", KeyType::Space, {Triangle}},
|
||||
//{4, 4, 4, 1, "Space", "△", KeyType::Space, {Triangle}},
|
||||
//{4, 5, 4, 1, "Space", "△", KeyType::Space, {Triangle}},
|
||||
|
@ -170,84 +167,8 @@ const std::vector<Key> kLowercaseLayout = {
|
|||
{5, 8, 2, 1, "Done", "R2", KeyType::Done, {R2}},
|
||||
//{5, 9, 2, 1, "Done", "R2", KeyType::Done, {R2}},
|
||||
};
|
||||
/*
|
||||
const std::vector<Key> kSymbols1Layout = {
|
||||
// Row 1
|
||||
{0, 0, 1, 1, "!", "", KeyType::Text, {}},
|
||||
{0, 1, 1, 1, "?", "", KeyType::Text, {}},
|
||||
{0, 2, 1, 1, "\"", "", KeyType::Text, {}},
|
||||
{0, 3, 1, 1, "'", "", KeyType::Text, {}},
|
||||
{0, 4, 1, 1, "#", "", KeyType::Text, {}},
|
||||
{0, 5, 1, 1, "%", "", KeyType::Text, {}},
|
||||
{0, 6, 1, 1, "(", "", KeyType::Text, {}},
|
||||
{0, 7, 1, 1, ")", "", KeyType::Text, {}},
|
||||
{0, 8, 1, 1, "()", "", KeyType::Text, {}},
|
||||
{0, 9, 1, 1, "/", "", KeyType::Text, {}},
|
||||
|
||||
// Row 2
|
||||
{1, 0, 1, 1, "-", "", KeyType::Text, {}},
|
||||
{1, 1, 1, 1, "_", "", KeyType::Text, {}},
|
||||
{1, 2, 1, 1, ",", "", KeyType::Text, {}},
|
||||
{1, 3, 1, 1, ".", "", KeyType::Text, {}},
|
||||
{1, 4, 1, 1, ":", "", KeyType::Text, {}},
|
||||
{1, 5, 1, 1, ";", "", KeyType::Text, {}},
|
||||
{1, 6, 1, 1, "*", "", KeyType::Text, {}},
|
||||
{1, 7, 1, 1, "+", "", KeyType::Text, {}},
|
||||
{1, 8, 1, 1, "=", "", KeyType::Text, {}},
|
||||
{1, 9, 1, 1, "&", "", KeyType::Text, {}},
|
||||
|
||||
// Row 3
|
||||
{2, 0, 1, 1, "<", "", KeyType::Text, {}},
|
||||
{2, 1, 1, 1, ">", "", KeyType::Text, {}},
|
||||
{2, 2, 1, 1, "@", "", KeyType::Text, {}},
|
||||
{2, 3, 1, 1, "[", "", KeyType::Text, {}},
|
||||
{2, 4, 1, 1, "]", "", KeyType::Text, {}},
|
||||
{2, 5, 1, 1, "[]", "", KeyType::Text, {}},
|
||||
{2, 6, 1, 1, "{", "", KeyType::Text, {}},
|
||||
{2, 7, 1, 1, "}", "", KeyType::Text, {}},
|
||||
{2, 8, 1, 1, "{}", "", KeyType::Text, {}},
|
||||
{2, 9, 1, 2, "→", "", KeyType::UnknownFunction, {}},
|
||||
|
||||
// Row 4
|
||||
{3, 0, 1, 1, "\\", "", KeyType::Text, {}},
|
||||
{3, 1, 1, 1, "|", "", KeyType::Text, {}},
|
||||
{3, 2, 1, 1, "^", "", KeyType::Text, {}},
|
||||
{3, 3, 1, 1, "`", "", KeyType::Text, {}},
|
||||
{3, 4, 1, 1, "$", "", KeyType::Text, {}},
|
||||
{3, 5, 1, 1, "€", "", KeyType::Text, {}},
|
||||
{3, 6, 1, 1, "´", "", KeyType::Text, {}},
|
||||
{3, 7, 1, 1, "ˊ", "", KeyType::Text, {}},
|
||||
{3, 8, 1, 1, "ˊ", "", KeyType::Text, {}},
|
||||
//{3, 9, 1, 2, "→", "", KeyType::UnknownFunction,{}},
|
||||
|
||||
// Row 5
|
||||
{4, 0, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{4, 1, 1, 1, "ABC", "L2+△", KeyType::TextLayout, {L2, Triangle}},
|
||||
{4, 2, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{4, 3, 4, 1, "Space", "△", KeyType::Space, {Triangle}},
|
||||
//{4, 4, 4, 1, "Space", "△", KeyType::Space, {Triangle}},
|
||||
//{4, 5, 4, 1, "Space", "△", KeyType::Space, {Triangle}},
|
||||
//{4, 6, 4, 1, "Space", "△", KeyType::Space, {Triangle}},
|
||||
{4, 7, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{4, 8, 2, 1, "⇦", "□", KeyType::Backspace, {Square}},
|
||||
//{4, 9, 2, 1, "⇦", "□", KeyType::Backspace, {Square}},
|
||||
|
||||
// Row 6
|
||||
{5, 0, 1, 1, "▲", "", KeyType::CursorUp, {Up}},
|
||||
{5, 1, 1, 1, "▼", "", KeyType::CursorDown, {Down}},
|
||||
{5, 2, 1, 1, "◀", "L1", KeyType::CursorLeft, {L1}},
|
||||
{5, 3, 1, 1, "▶", "R1", KeyType::CursorRight, {R1}},
|
||||
{5, 4, 1, 1, "KB", "", KeyType::ToggleKeyboard, {}},
|
||||
{5, 5, 1, 1, "...", "", KeyType::MoreOptions, {}},
|
||||
{5, 6, 1, 1, "+/⊗", "R3", KeyType::ControllerAction, {R3}},
|
||||
{5, 7, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{5, 8, 2, 1, "Done", "R2", KeyType::Done, {R2}},
|
||||
//{5, 9, 2, 1, "Done", "R2", KeyType::Done, {R2}},
|
||||
|
||||
};
|
||||
*/
|
||||
// From PS5
|
||||
const std::vector<Key> kSymbols1Layout = {
|
||||
const std::vector<Key> kLayoutEnSymbols1 = {
|
||||
// Row 1
|
||||
{0, 0, 1, 1, "!", "", KeyType::Text, {}},
|
||||
{0, 1, 1, 1, "?", "", KeyType::Text, {}},
|
||||
|
@ -298,7 +219,7 @@ const std::vector<Key> kSymbols1Layout = {
|
|||
|
||||
// Row 5
|
||||
{4, 0, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{4, 1, 1, 1, "ABC", "L2+△", KeyType::TextLayout, {L2, Triangle}},
|
||||
{4, 1, 1, 1, "ABC", "L2+△", KeyType::LettersLayout, {L2, Triangle}},
|
||||
{4, 2, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{4, 3, 4, 1, "Space", "△", KeyType::Space, {Triangle}},
|
||||
//{4, 4, 4, 1, "Space", "△", KeyType::Space, {Triangle}},
|
||||
|
@ -323,7 +244,7 @@ const std::vector<Key> kSymbols1Layout = {
|
|||
};
|
||||
|
||||
// From PS5
|
||||
const std::vector<Key> kSymbols2Layout = {
|
||||
const std::vector<Key> kLayoutEnSymbols2 = {
|
||||
// Row 1
|
||||
{0, 0, 1, 1, "“", "", KeyType::Text, {}},
|
||||
{0, 1, 1, 1, "”", "", KeyType::Text, {}},
|
||||
|
@ -374,7 +295,7 @@ const std::vector<Key> kSymbols2Layout = {
|
|||
|
||||
// Row 5
|
||||
{4, 0, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{4, 1, 1, 1, "ABC", "L2+△", KeyType::TextLayout, {L2, Triangle}},
|
||||
{4, 1, 1, 1, "ABC", "L2+△", KeyType::LettersLayout, {L2, Triangle}},
|
||||
{4, 2, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{4, 3, 4, 1, "Space", "△", KeyType::Space, {Triangle}},
|
||||
//{4, 4, 4, 1, "Space", "△", KeyType::Space, {Triangle}},
|
||||
|
@ -396,4 +317,177 @@ const std::vector<Key> kSymbols2Layout = {
|
|||
{5, 8, 2, 1, "Done", "R2", KeyType::Done, {R2}},
|
||||
//{5, 9, 2, 1, "Done", "R2", KeyType::Done, {R2}},
|
||||
|
||||
};
|
||||
|
||||
const std::vector<Key> kLayoutEnAccentLettersUppercase = {
|
||||
// Row 0
|
||||
{0, 0, 1, 1, "À", "", KeyType::Text, {}},
|
||||
{0, 1, 1, 1, "Á", "", KeyType::Text, {}},
|
||||
{0, 2, 1, 1, "Â", "", KeyType::Text, {}},
|
||||
{0, 3, 1, 1, "Ã", "", KeyType::Text, {}},
|
||||
{0, 4, 1, 1, "Ä", "", KeyType::Text, {}},
|
||||
{0, 5, 1, 1, "Å", "", KeyType::Text, {}},
|
||||
{0, 6, 1, 1, "Ą", "", KeyType::Text, {}},
|
||||
{0, 7, 1, 1, "Æ", "", KeyType::Text, {}},
|
||||
{0, 8, 1, 1, "Ç", "", KeyType::Text, {}},
|
||||
{0, 9, 1, 1, "Ć", "", KeyType::Text, {}},
|
||||
|
||||
// Row 1
|
||||
{1, 0, 1, 1, "È", "", KeyType::Text, {}},
|
||||
{1, 1, 1, 1, "É", "", KeyType::Text, {}},
|
||||
{1, 2, 1, 1, "Ê", "", KeyType::Text, {}},
|
||||
{1, 3, 1, 1, "Ë", "", KeyType::Text, {}},
|
||||
{1, 4, 1, 1, "Ę", "", KeyType::Text, {}},
|
||||
{1, 5, 1, 1, "Ğ", "", KeyType::Text, {}},
|
||||
{1, 6, 1, 1, "Ì", "", KeyType::Text, {}},
|
||||
{1, 7, 1, 1, "Í", "", KeyType::Text, {}},
|
||||
{1, 8, 1, 1, "Î", "", KeyType::Text, {}},
|
||||
{1, 9, 1, 1, "Ï", "", KeyType::Text, {}},
|
||||
|
||||
// Row 2
|
||||
{2, 0, 1, 1, "İ", "", KeyType::Text, {}},
|
||||
{2, 1, 1, 1, "Ł", "", KeyType::Text, {}},
|
||||
{2, 2, 1, 1, "Ñ", "", KeyType::Text, {}},
|
||||
{2, 3, 1, 1, "Ń", "", KeyType::Text, {}},
|
||||
{2, 4, 1, 1, "Ò", "", KeyType::Text, {}},
|
||||
{2, 5, 1, 1, "Ó", "", KeyType::Text, {}},
|
||||
{2, 6, 1, 1, "Ô", "", KeyType::Text, {}},
|
||||
{2, 7, 1, 1, "Õ", "", KeyType::Text, {}},
|
||||
{2, 8, 1, 1, "Ö", "", KeyType::Text, {}},
|
||||
{2, 9, 1, 1, "Ø", "", KeyType::Text, {}},
|
||||
|
||||
// Row 3
|
||||
{3, 0, 1, 1, "Œ", "", KeyType::Text, {}},
|
||||
{3, 1, 1, 1, "Ś", "", KeyType::Text, {}},
|
||||
{3, 2, 1, 1, "Ş", "", KeyType::Text, {}},
|
||||
{3, 3, 1, 1, "Š", "", KeyType::Text, {}},
|
||||
{3, 4, 1, 1, "ß", "", KeyType::Text, {}},
|
||||
{3, 5, 1, 1, "Ù", "", KeyType::Text, {}},
|
||||
{3, 6, 1, 1, "Ú", "", KeyType::Text, {}},
|
||||
{3, 7, 1, 1, "Û", "", KeyType::Text, {}},
|
||||
{3, 8, 1, 1, "Ü", "", KeyType::Text, {}},
|
||||
{3, 9, 1, 1, "Ý", "", KeyType::Text, {}},
|
||||
|
||||
// Row 4
|
||||
{4, 0, 1, 1, "Ÿ", "", KeyType::Text, {}},
|
||||
{4, 1, 1, 1, "Ź", "", KeyType::Text, {}},
|
||||
{4, 2, 1, 1, "Ż", "", KeyType::Text, {}},
|
||||
{4, 3, 1, 1, "Ž", "", KeyType::Text, {}},
|
||||
{4, 4, 1, 1, "Ð", "", KeyType::Text, {}},
|
||||
{4, 5, 1, 1, "Þ", "", KeyType::Text, {}},
|
||||
{4, 6, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{4, 7, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{4, 8, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{4, 9, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
|
||||
// Row 5
|
||||
{5, 0, 1, 1, "⬆", "L2", KeyType::Shift, {L2}},
|
||||
{5, 1, 1, 1, "@#:", "L2+△", KeyType::Symbols1Layout, {L3, Triangle}},
|
||||
{5, 2, 1, 1, "à", "L3", KeyType::AccentLettersLayout, {L3}},
|
||||
{5, 3, 4, 1, "Space", "△", KeyType::Space, {Triangle}},
|
||||
//{4, 4, 4, 1, "Space", "△", KeyType::Space,{Triangle}},
|
||||
//{4, 5, 4, 1, "Space", "△", KeyType::Space,{Triangle}},
|
||||
//{4, 6, 4, 1, "Space", "△", KeyType::Space,{Triangle}},
|
||||
{4, 7, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{5, 8, 2, 1, "⇦", "□", KeyType::Backspace, {Square}},
|
||||
//{4, 9, 2, 1, "⇦", "□", KeyType::Backspace,{Square}},
|
||||
|
||||
// Row 6
|
||||
{6, 0, 1, 1, "▲", "", KeyType::CursorUp, {Up}},
|
||||
{6, 1, 1, 1, "▼", "", KeyType::CursorDown, {Down}},
|
||||
{6, 2, 1, 1, "◀", "L1", KeyType::CursorLeft, {L1}},
|
||||
{6, 3, 1, 1, "▶", "R1", KeyType::CursorRight, {R1}},
|
||||
{6, 4, 1, 1, "KB", "", KeyType::ToggleKeyboard, {}},
|
||||
{6, 5, 1, 1, "...", "", KeyType::MoreOptions, {}},
|
||||
{6, 6, 1, 1, "+/⊗", "R3", KeyType::ControllerAction, {R3}},
|
||||
{5, 7, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{6, 8, 2, 1, "Done", "R2", KeyType::Done, {R2}},
|
||||
//{5, 9, 2, 1, "Done", "R2", KeyType::Done,{R2}},
|
||||
};
|
||||
|
||||
const std::vector<Key> kLayoutEnAccentLettersLowercase = {
|
||||
// Row 0
|
||||
{0, 0, 1, 1, "à", "", KeyType::Text, {}},
|
||||
{0, 1, 1, 1, "á", "", KeyType::Text, {}},
|
||||
{0, 2, 1, 1, "â", "", KeyType::Text, {}},
|
||||
{0, 3, 1, 1, "ã", "", KeyType::Text, {}},
|
||||
{0, 4, 1, 1, "ä", "", KeyType::Text, {}},
|
||||
{0, 5, 1, 1, "å", "", KeyType::Text, {}},
|
||||
{0, 6, 1, 1, "ą", "", KeyType::Text, {}},
|
||||
{0, 7, 1, 1, "æ", "", KeyType::Text, {}},
|
||||
{0, 8, 1, 1, "ç", "", KeyType::Text, {}},
|
||||
{0, 9, 1, 1, "ć", "", KeyType::Text, {}},
|
||||
|
||||
// Row 1
|
||||
{1, 0, 1, 1, "è", "", KeyType::Text, {}},
|
||||
{1, 1, 1, 1, "é", "", KeyType::Text, {}},
|
||||
{1, 2, 1, 1, "ê", "", KeyType::Text, {}},
|
||||
{1, 3, 1, 1, "ë", "", KeyType::Text, {}},
|
||||
{1, 4, 1, 1, "ę", "", KeyType::Text, {}},
|
||||
{1, 5, 1, 1, "ğ", "", KeyType::Text, {}},
|
||||
{1, 6, 1, 1, "ì", "", KeyType::Text, {}},
|
||||
{1, 7, 1, 1, "í", "", KeyType::Text, {}},
|
||||
{1, 8, 1, 1, "î", "", KeyType::Text, {}},
|
||||
{1, 9, 1, 1, "ï", "", KeyType::Text, {}},
|
||||
|
||||
// Row 2
|
||||
{2, 0, 1, 1, "ı", "", KeyType::Text, {}},
|
||||
{2, 1, 1, 1, "ł", "", KeyType::Text, {}},
|
||||
{2, 2, 1, 1, "ñ", "", KeyType::Text, {}},
|
||||
{2, 3, 1, 1, "ń", "", KeyType::Text, {}},
|
||||
{2, 4, 1, 1, "ò", "", KeyType::Text, {}},
|
||||
{2, 5, 1, 1, "ó", "", KeyType::Text, {}},
|
||||
{2, 6, 1, 1, "ô", "", KeyType::Text, {}},
|
||||
{2, 7, 1, 1, "õ", "", KeyType::Text, {}},
|
||||
{2, 8, 1, 1, "ö", "", KeyType::Text, {}},
|
||||
{2, 9, 1, 1, "ø", "", KeyType::Text, {}},
|
||||
|
||||
// Row 3
|
||||
{3, 0, 1, 1, "œ", "", KeyType::Text, {}},
|
||||
{3, 1, 1, 1, "ś", "", KeyType::Text, {}},
|
||||
{3, 2, 1, 1, "ş", "", KeyType::Text, {}},
|
||||
{3, 3, 1, 1, "š", "", KeyType::Text, {}},
|
||||
{3, 4, 1, 1, "ß", "", KeyType::Text, {}},
|
||||
{3, 5, 1, 1, "ù", "", KeyType::Text, {}},
|
||||
{3, 6, 1, 1, "ú", "", KeyType::Text, {}},
|
||||
{3, 7, 1, 1, "û", "", KeyType::Text, {}},
|
||||
{3, 8, 1, 1, "ü", "", KeyType::Text, {}},
|
||||
{3, 9, 1, 1, "ý", "", KeyType::Text, {}},
|
||||
|
||||
// Row 4
|
||||
{4, 0, 1, 1, "ÿ", "", KeyType::Text, {}},
|
||||
{4, 1, 1, 1, "ź", "", KeyType::Text, {}},
|
||||
{4, 2, 1, 1, "ż", "", KeyType::Text, {}},
|
||||
{4, 3, 1, 1, "ž", "", KeyType::Text, {}},
|
||||
{4, 4, 1, 1, "ð", "", KeyType::Text, {}},
|
||||
{4, 5, 1, 1, "þ", "", KeyType::Text, {}},
|
||||
{4, 6, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{4, 7, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{4, 8, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{4, 9, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
|
||||
// Row 5
|
||||
{5, 0, 1, 1, "⬆", "L2", KeyType::Shift, {L2}},
|
||||
{5, 1, 1, 1, "@#:", "L2+△", KeyType::Symbols1Layout, {L3, Triangle}},
|
||||
{5, 2, 1, 1, "à", "L3", KeyType::AccentLettersLayout, {L3}},
|
||||
{5, 3, 4, 1, "Space", "△", KeyType::Space, {Triangle}},
|
||||
//{4, 4, 4, 1, "Space", "△", KeyType::Space,{Triangle}},
|
||||
//{4, 5, 4, 1, "Space", "△", KeyType::Space,{Triangle}},
|
||||
//{4, 6, 4, 1, "Space", "△", KeyType::Space,{Triangle}},
|
||||
{4, 7, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{5, 8, 2, 1, "⇦", "□", KeyType::Backspace, {Square}},
|
||||
//{4, 9, 2, 1, "⇦", "□", KeyType::Backspace,{Square}},
|
||||
|
||||
// Row 6
|
||||
{6, 0, 1, 1, "▲", "", KeyType::CursorUp, {Up}},
|
||||
{6, 1, 1, 1, "▼", "", KeyType::CursorDown, {Down}},
|
||||
{6, 2, 1, 1, "◀", "L1", KeyType::CursorLeft, {L1}},
|
||||
{6, 3, 1, 1, "▶", "R1", KeyType::CursorRight, {R1}},
|
||||
{6, 4, 1, 1, "KB", "", KeyType::ToggleKeyboard, {}},
|
||||
{6, 5, 1, 1, "...", "", KeyType::MoreOptions, {}},
|
||||
//{5, 5, 1, 1, "…", "", KeyType::MoreOptions,{}},
|
||||
{6, 6, 1, 1, "+/⊗", "R3", KeyType::ControllerAction, {R3}},
|
||||
{5, 7, 1, 1, "", "", KeyType::Disabled, {}},
|
||||
{6, 8, 2, 1, "Done", "R2", KeyType::Done, {R2}},
|
||||
//{5, 9, 2, 1, "Done", "R2", KeyType::Done,{R2}},
|
||||
};
|
|
@ -8,22 +8,23 @@
|
|||
#include <imgui.h>
|
||||
|
||||
enum class KeyType {
|
||||
Text, // Inserts character(s) into input buffer
|
||||
Backspace, // Deletes last character
|
||||
Space, // Adds space
|
||||
Enter, // Submits input
|
||||
Shift, // Toggle uppercase/lowercase
|
||||
Symbols1Layout, // Switch to symbols layout
|
||||
Symbols2Layout, // Switch to symbols layout
|
||||
TextLayout, // Switch to text layout
|
||||
Done, // Finish and close keyboard
|
||||
Text, // Inserts character(s) into input buffer
|
||||
Backspace, // Deletes last character
|
||||
Space, // Adds space
|
||||
Enter, // Submits input
|
||||
Shift, // Toggle uppercase/lowercase
|
||||
Symbols1Layout, // Switch to symbols layout
|
||||
Symbols2Layout, // Switch to symbols layout
|
||||
LettersLayout, // Switch to text layout
|
||||
AccentLettersLayout, // Switch to accent text layout
|
||||
Done, // Finish and close keyboard
|
||||
CursorLeft,
|
||||
CursorRight,
|
||||
CursorUp,
|
||||
CursorDown,
|
||||
ToggleKeyboard, // Toggles keyboard layout
|
||||
MoreOptions, // "..." button
|
||||
ControllerAction, // e.g. R3 🎮⊕
|
||||
ControllerAction, // e.g. R3 +/⊕
|
||||
Disabled, // Filler or placeholder
|
||||
UnknownFunction, // now same as disabled
|
||||
};
|
||||
|
@ -39,7 +40,9 @@ struct Key {
|
|||
std::vector<ImGuiNavInput> bound_buttons = {}; // Now using ImGui navigation inputs
|
||||
};
|
||||
|
||||
extern const std::vector<Key> kUppercaseLayout;
|
||||
extern const std::vector<Key> kLowercaseLayout;
|
||||
extern const std::vector<Key> kSymbols1Layout;
|
||||
extern const std::vector<Key> kSymbols2Layout;
|
||||
extern const std::vector<Key> kLayoutEnLettersUppercase;
|
||||
extern const std::vector<Key> kLayoutEnLettersLowercase;
|
||||
extern const std::vector<Key> kLayoutEnAccentLettersUppercase;
|
||||
extern const std::vector<Key> kLayoutEnAccentLettersLowercase;
|
||||
extern const std::vector<Key> kLayoutEnSymbols1;
|
||||
extern const std::vector<Key> kLayoutEnSymbols2;
|
||||
|
|
|
@ -32,13 +32,18 @@ void DrawVirtualKeyboard(char* buffer, std::size_t buffer_capacity, bool* input_
|
|||
|
||||
switch (kb_mode) {
|
||||
case KeyboardMode::Symbols1:
|
||||
layout = &kSymbols1Layout;
|
||||
layout = &kLayoutEnSymbols1;
|
||||
break;
|
||||
case KeyboardMode::Symbols2:
|
||||
layout = &kSymbols2Layout;
|
||||
layout = &kLayoutEnSymbols2;
|
||||
break;
|
||||
case KeyboardMode::Letters2:
|
||||
layout =
|
||||
shift_enabled ? &kLayoutEnAccentLettersUppercase : &kLayoutEnAccentLettersLowercase;
|
||||
break;
|
||||
case KeyboardMode::Letters1:
|
||||
default:
|
||||
layout = shift_enabled ? &kUppercaseLayout : &kLowercaseLayout;
|
||||
layout = shift_enabled ? &kLayoutEnLettersUppercase : &kLayoutEnLettersLowercase;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -122,9 +127,13 @@ void RenderKeyboardLayout(const std::vector<Key>& layout, char* buffer, std::siz
|
|||
case KeyType::Symbols2Layout:
|
||||
kb_mode = KeyboardMode::Symbols2;
|
||||
break;
|
||||
case KeyType::TextLayout:
|
||||
case KeyType::LettersLayout:
|
||||
kb_mode = KeyboardMode::Letters1;
|
||||
break;
|
||||
case KeyType::AccentLettersLayout:
|
||||
kb_mode = KeyboardMode::Letters2;
|
||||
break;
|
||||
|
||||
case KeyType::ToggleKeyboard:
|
||||
kb_mode = (kb_mode == KeyboardMode::Letters1) ? KeyboardMode::Symbols1
|
||||
: KeyboardMode::Letters1;
|
||||
|
|
Loading…
Add table
Reference in a new issue