mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 00:32: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 {
|
namespace {
|
||||||
|
|
||||||
int32_t OnChar(const EVENT_DATA_CHAR* data, void* param) {
|
int32_t OnChar(const EVENT_DATA_CHAR* data, void* param) {
|
||||||
if (!EventIsKeyDown(ConsoleGetHotKey()) || !ConsoleAccessGetEnabled()) {
|
if (EventIsKeyDown(ConsoleGetHotKey()) && ConsoleAccessGetEnabled()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!ConsoleGetActive()) {
|
if (!ConsoleGetActive()) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char character[2];
|
char inputLine[2];
|
||||||
character[0] = data->ch;
|
inputLine[0] = data->ch;
|
||||||
character[1] = '\0';
|
inputLine[1] = '\0';
|
||||||
|
|
||||||
|
PasteInInputLine(inputLine);
|
||||||
|
|
||||||
PasteInInputLine(character);
|
|
||||||
ResetHighlight();
|
ResetHighlight();
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user