From a5778d0de52e2bb45a78794bfb295e879a24c557 Mon Sep 17 00:00:00 2001 From: Alexander Zhirov Date: Mon, 5 Jan 2026 01:02:33 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D0=BC=D0=BE=D0=B4?= =?UTF-8?q?=D1=83=D0=BB=D1=8C=20event.d=20=D1=81=20=D1=81=D0=BE=D0=B1?= =?UTF-8?q?=D1=8B=D1=82=D0=B8=D1=8F=D0=BC=D0=B8=20=D0=BD=D0=B0=D0=B6=D0=B0?= =?UTF-8?q?=D1=82=D0=B8=D0=B9=20=D0=BA=D0=BB=D0=B0=D0=B2=D0=B8=D1=88=20?= =?UTF-8?q?=D1=83=20=D1=82=D0=B5=D0=BA=D1=83=D1=89=D0=B5=D0=B3=D0=BE=20WIN?= =?UTF-8?q?DOW?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ncui/core/event.d | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 source/ncui/core/event.d diff --git a/source/ncui/core/event.d b/source/ncui/core/event.d new file mode 100644 index 0000000..6928c64 --- /dev/null +++ b/source/ncui/core/event.d @@ -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; + } +}