mirror of
https://github.com/ggerganov/wave-share.git
synced 2026-04-18 12:25:59 +08:00
add option to resend last input
This commit is contained in:
9
main.cpp
9
main.cpp
@@ -994,12 +994,19 @@ int main(int argc, char** argv) {
|
|||||||
};
|
};
|
||||||
printf("\n");
|
printf("\n");
|
||||||
std::thread inputThread([]() {
|
std::thread inputThread([]() {
|
||||||
|
std::string inputOld = "";
|
||||||
while (true) {
|
while (true) {
|
||||||
std::string input;
|
std::string input;
|
||||||
std::cout << "Enter text: ";
|
std::cout << "Enter text: ";
|
||||||
getline(std::cin, input);
|
getline(std::cin, input);
|
||||||
|
if (input.empty()) {
|
||||||
|
std::cout << "Re-sending ... " << std::endl;
|
||||||
|
input = inputOld;
|
||||||
|
} else {
|
||||||
|
std::cout << "Sending ... " << std::endl;
|
||||||
|
}
|
||||||
setText(input.size(), input.data());
|
setText(input.size(), input.data());
|
||||||
std::cout << "Sending ... " << std::endl;
|
inputOld = input;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user