Добавлен новый модуль event.d с событиями нажатий клавиш у текущего WINDOW
This commit is contained in:
parent
7a3b0e33db
commit
a5778d0de5
1 changed files with 30 additions and 0 deletions
30
source/ncui/core/event.d
Normal file
30
source/ncui/core/event.d
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue