mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2026-02-05 01:29:07 +00:00
fix(console): use SUniSPutUTF8 in OnChar handler
This commit is contained in:
parent
9df49cd3f7
commit
eeab035664
2 changed files with 37 additions and 38 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include "console/Command.hpp"
|
||||
#include "console/Screen.hpp"
|
||||
#include "event/Event.hpp"
|
||||
#include "storm/Unicode.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
static int32_t s_historyIndex = 0;
|
||||
|
|
@ -11,24 +12,20 @@ static int32_t s_historyIndex = 0;
|
|||
namespace {
|
||||
|
||||
int32_t OnChar(const EVENT_DATA_CHAR* data, void* param) {
|
||||
char character[2];
|
||||
char character[8] = {};
|
||||
|
||||
if (ConsoleAccessGetEnabled() && EventIsKeyDown(ConsoleGetHotKey())) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ConsoleGetActive()) {
|
||||
character[0] = char(data->ch);
|
||||
character[1] = 0;
|
||||
SUniSPutUTF8(data->ch, character);
|
||||
|
||||
PasteInInputLine(character);
|
||||
ResetHighlight();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// SUniSPutUTF8(data->ch, character);
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue