Skip to content

Commit

Permalink
French keyboard fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
XITRIX committed Jan 7, 2025
1 parent 1a7a76b commit adc90d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions app/src/keyboard_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,23 +151,24 @@ void ButtonView::applyTitle() {
if (dummy)
return;

bool shifted = keysState[VK_RSHIFT];
auto selectedLang = getCurrentLocale();
charLabel->setText(selectedLang.localization[key][shifted]);
}

void ButtonView::setKey(KeyboardKeys key) {
auto selectedLang = getCurrentLocale();
// We need to map only key title, virtual keys are constant (which could be a bug in Sunshine)
KeyboardKeys mappedKey = key;
auto selectedLang = getCurrentLocale();
if (selectedLang.keyMapper.contains(key)) {
mappedKey = selectedLang.keyMapper[key];
}

bool shifted = keysState[VK_RSHIFT];
charLabel->setText(selectedLang.localization[mappedKey][shifted]);
}

void ButtonView::setKey(KeyboardKeys key) {

this->dummy = false;
this->key = mappedKey;
this->key = key;
this->applyTitle();

if (keysState[mappedKey])
if (keysState[key])
this->playClickAnimation(false, false, true);
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/keyboards/keyboard_locales.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void KeyboardView::createLocales() {
{"r", "R"}, {"s", "S"}, {"t", "T"}, {"u", "U"}, {"v", "V"}, {"w", "W"}, {"x", "X"}, {"y", "Y"}, {"z", "Z"}, {"Return", "Return"}, {"Space", "Space"},
{"Ctrl", "Ctrl"}, {"Alt", "Alt"}, {"Shift", "Shift"}, {"Win", "Win"}, {",", "?"}, {";", "."}, {"F1", "F1"}, {"F2", "F2"}, {"F3", "F3"}, {"F4", "F4"},
{"F5", "F5"}, {"F6", "F6"}, {"F7", "F7"}, {"F8", "F8"}, {"F9", "F9"}, {"F10", "F10"}, {"F11", "F11"}, {"F12", "F12"}, {"Tab", "Tab"}, {"Delete", "Delete"},
{"!", "§"}, {":", "/"}, {"<", ">"}, {"ù", "%"}, {"*", "μ"}, {"=", "+"}, {")", "°"}, {"^", "¨"}, {"$", "£"}, {"\u2193", "\u2193"},
{"!", "§"}, {":", "/"}, {"²", "²"}, {"ù", "%"}, {"*", "μ"}, {"=", "+"}, {")", "°"}, {"^", "¨"}, {"$", "£"}, {"\u2193", "\u2193"},
{"\u2190", "\u2190"}, {"\u2192", "\u2192"}, {"\u2191", "\u2191"}, {"CapsLock", "CapsLock"},
},
.keyMapper = {{VK_OEM_MINUS, VK_OEM_7}, {VK_OEM_PLUS, VK_OEM_6},
Expand Down

0 comments on commit adc90d5

Please sign in to comment.