mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 08:42:45 +03:00
feat(console): add partial implementation for function OnKeyDown
This commit is contained in:
parent
01ca76788c
commit
324b7408df
@ -1,4 +1,5 @@
|
||||
#include "console/Handlers.hpp"
|
||||
#include "console/Console.hpp"
|
||||
#include "event/Event.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
@ -15,9 +16,29 @@ int32_t OnIdle(const EVENT_DATA_IDLE* data, void* param) {
|
||||
}
|
||||
|
||||
int32_t OnKeyDown(const EVENT_DATA_KEY* data, void* param) {
|
||||
bool active;
|
||||
|
||||
if (data->key == ConsoleGetHotKey() && ConsoleAccessGetEnabled()) {
|
||||
active = ConsoleGetActive() == false;
|
||||
|
||||
ConsoleSetActive(active);
|
||||
|
||||
if (!active) {
|
||||
// TODO
|
||||
// ResetHighlight();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
else if (EventIsKeyDown(ConsoleGetHotKey()) || !ConsoleGetActive()) {
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
// TODO
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int32_t OnKeyDownRepeat(const EVENT_DATA_KEY* data, void* param) {
|
||||
// TODO
|
||||
|
||||
Loading…
Reference in New Issue
Block a user