mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
chore(console): improve clarity in OnChar event handler
This commit is contained in:
parent
e39d1913f4
commit
4313dd50e5
@ -11,18 +11,22 @@ void PasteInInputLine(const char* inputLine);
|
||||
namespace {
|
||||
|
||||
int32_t OnChar(const EVENT_DATA_CHAR* data, void* param) {
|
||||
if (!EventIsKeyDown(ConsoleGetHotKey()) || !ConsoleAccessGetEnabled()) {
|
||||
if (!ConsoleGetActive()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
char character[2];
|
||||
character[0] = data->ch;
|
||||
character[1] = '\0';
|
||||
|
||||
PasteInInputLine(character);
|
||||
ResetHighlight();
|
||||
if (EventIsKeyDown(ConsoleGetHotKey()) && ConsoleAccessGetEnabled()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!ConsoleGetActive()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
char inputLine[2];
|
||||
inputLine[0] = data->ch;
|
||||
inputLine[1] = '\0';
|
||||
|
||||
PasteInInputLine(inputLine);
|
||||
|
||||
ResetHighlight();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user