This commit is contained in:
2023-07-06 21:48:42 +03:00
parent b763f0e5cd
commit b19d50ba62
3 changed files with 14 additions and 11 deletions

View File

@@ -19,6 +19,7 @@
#include "pikbdlistener.h"
#include "piincludes_p.h"
#include "piliterals.h"
#ifndef WINDOWS
# include <termios.h>
#else
@@ -147,7 +148,7 @@ PRIVATE_DEFINITION_END(PIKbdListener)
PIKbdListener::PIKbdListener(KBFunc slot, void * _d, bool startNow): PIThread() {
setName("keyboard_listener");
setName("keyboard_listener"_a);
_object = this;
#ifdef WINDOWS
PRIVATE->hIn = GetStdHandle(STD_INPUT_HANDLE);
@@ -526,7 +527,7 @@ void PIKbdListener::readKeyboard() {
cout << "'" << (char)(rc[i]) << "' ";
cout << endl;*/
}
if (ke.key == 0 && PRIVATE->ret > 1) ke.key = PIChar(rc).unicode16Code();
if (ke.key == 0 && PRIVATE->ret > 1) ke.key = PIChar::fromSystem(rc).unicode16Code();
#endif
if ((rc[0] == '\n' || rc[0] == '\r') && PRIVATE->ret == 1) ke.key = Return;
if (exit_enabled && ke.key == exit_key) {