summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/applets/qt_software_keyboard.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/yuzu/applets/qt_software_keyboard.cpp b/src/yuzu/applets/qt_software_keyboard.cpp
index d3cf0b43b..135e06085 100644
--- a/src/yuzu/applets/qt_software_keyboard.cpp
+++ b/src/yuzu/applets/qt_software_keyboard.cpp
@@ -411,11 +411,11 @@ void QtSoftwareKeyboardDialog::ShowTextCheckDialog(
411 break; 411 break;
412 } 412 }
413 413
414 auto text = ui->topOSK->currentIndex() == 1 414 const auto& text = ui->topOSK->currentIndex() == 1 ? ui->text_edit_osk->toPlainText()
415 ? ui->text_edit_osk->toPlainText().toStdU16String() 415 : ui->line_edit_osk->text();
416 : ui->line_edit_osk->text().toStdU16String(); 416 std::u16string text_s = Common::U16StringFromBuffer(text.utf16(), text.size());
417 417
418 emit SubmitNormalText(SwkbdResult::Ok, std::move(text), true); 418 emit SubmitNormalText(SwkbdResult::Ok, std::move(text_s), true);
419 break; 419 break;
420 } 420 }
421 } 421 }
@@ -562,7 +562,7 @@ void QtSoftwareKeyboardDialog::keyPressEvent(QKeyEvent* event) {
562 return; 562 return;
563 } 563 }
564 564
565 InlineTextInsertString(entered_text.toStdU16String()); 565 InlineTextInsertString(Common::U16StringFromBuffer(entered_text.utf16(), entered_text.size()));
566} 566}
567 567
568void QtSoftwareKeyboardDialog::MoveAndResizeWindow(QPoint pos, QSize size) { 568void QtSoftwareKeyboardDialog::MoveAndResizeWindow(QPoint pos, QSize size) {
@@ -1119,11 +1119,11 @@ void QtSoftwareKeyboardDialog::NormalKeyboardButtonClicked(QPushButton* button)
1119 } 1119 }
1120 1120
1121 if (button == ui->button_ok || button == ui->button_ok_shift || button == ui->button_ok_num) { 1121 if (button == ui->button_ok || button == ui->button_ok_shift || button == ui->button_ok_num) {
1122 auto text = ui->topOSK->currentIndex() == 1 1122 const auto& text = ui->topOSK->currentIndex() == 1 ? ui->text_edit_osk->toPlainText()
1123 ? ui->text_edit_osk->toPlainText().toStdU16String() 1123 : ui->line_edit_osk->text();
1124 : ui->line_edit_osk->text().toStdU16String(); 1124 std::u16string text_s = Common::U16StringFromBuffer(text.utf16(), text.size());
1125 1125
1126 emit SubmitNormalText(SwkbdResult::Ok, std::move(text)); 1126 emit SubmitNormalText(SwkbdResult::Ok, std::move(text_s));
1127 return; 1127 return;
1128 } 1128 }
1129 1129
@@ -1189,7 +1189,8 @@ void QtSoftwareKeyboardDialog::InlineKeyboardButtonClicked(QPushButton* button)
1189 return; 1189 return;
1190 } 1190 }
1191 1191
1192 InlineTextInsertString(button->text().toStdU16String()); 1192 InlineTextInsertString(
1193 Common::U16StringFromBuffer(button->text().utf16(), button->text().size()));
1193 1194
1194 // Revert the keyboard to lowercase if the shift key is active. 1195 // Revert the keyboard to lowercase if the shift key is active.
1195 if (bottom_osk_index == BottomOSKIndex::UpperCase && !caps_lock_enabled) { 1196 if (bottom_osk_index == BottomOSKIndex::UpperCase && !caps_lock_enabled) {
@@ -1282,11 +1283,11 @@ void QtSoftwareKeyboardDialog::TranslateButtonPress(Core::HID::NpadButton button
1282 if (is_inline) { 1283 if (is_inline) {
1283 emit SubmitInlineText(SwkbdReplyType::DecidedCancel, current_text, cursor_position); 1284 emit SubmitInlineText(SwkbdReplyType::DecidedCancel, current_text, cursor_position);
1284 } else { 1285 } else {
1285 auto text = ui->topOSK->currentIndex() == 1 1286 const auto& text = ui->topOSK->currentIndex() == 1 ? ui->text_edit_osk->toPlainText()
1286 ? ui->text_edit_osk->toPlainText().toStdU16String() 1287 : ui->line_edit_osk->text();
1287 : ui->line_edit_osk->text().toStdU16String(); 1288 std::u16string text_s = Common::U16StringFromBuffer(text.utf16(), text.size());
1288 1289
1289 emit SubmitNormalText(SwkbdResult::Cancel, std::move(text)); 1290 emit SubmitNormalText(SwkbdResult::Cancel, std::move(text_s));
1290 } 1291 }
1291 break; 1292 break;
1292 case Core::HID::NpadButton::Y: 1293 case Core::HID::NpadButton::Y: