Добавлен новый модуль event.d с событиями нажатий клавиш у текущего WINDOW

This commit is contained in:
Alexander Zhirov 2026-01-05 01:02:33 +03:00
parent 7a3b0e33db
commit a5778d0de5
Signed by: alexander
GPG key ID: C8D8BE544A27C511

30
source/ncui/core/event.d Normal file
View file

@ -0,0 +1,30 @@
module ncui.core.event;
import deimos.ncurses : KEY_CODE_YES, OK, ERR;
struct KeyEvent
{
int status;
dchar ch;
this(int status, dchar ch)
{
this.status = status;
this.ch = ch;
}
bool isKeyCode() const
{
return status == KEY_CODE_YES;
}
bool isChar() const
{
return status == OK;
}
bool isErr() const
{
return status == ERR;
}
}