From fc92071f2b75bd72b11285efd2d19f4f7380ac6c Mon Sep 17 00:00:00 2001
From: yixy <1907860402@qq.com>
Date: Mon, 29 Aug 2022 02:49:24 +0800
Subject: [PATCH] =?UTF-8?q?fix:=E6=A0=87=E8=AE=B0=E6=8C=89=E9=94=AE?=
 =?UTF-8?q?=E6=8C=89=E4=B8=8B=E6=97=B6=E7=AC=AC=E4=B8=80=E6=AC=A1=E5=8F=91?=
 =?UTF-8?q?=E9=80=81=E7=9A=84down=E6=B6=88=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/ege.h        | 5 +++--
 src/graphics.cpp | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/ege.h b/src/ege.h
index 0df923c6..488a4fba 100644
--- a/src/ege.h
+++ b/src/ege.h
@@ -601,8 +601,9 @@ typedef enum key_msg_e {
 	key_msg_char    = 4,
 }key_msg_e;
 typedef enum key_flag_e {
-	key_flag_shift  = 0x100,
-	key_flag_ctrl   = 0x200,
+	key_flag_shift      = 0x100,
+	key_flag_ctrl       = 0x200,
+	key_flag_first_down = 0x80000,
 }key_flag_e;
 
 typedef enum mouse_msg_e {
diff --git a/src/graphics.cpp b/src/graphics.cpp
index fbe43121..0a5e7f9c 100755
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -400,6 +400,7 @@ getkey() {
 				else if (key & KEYMSG_CHAR)
 					msg.msg = key_msg_char;
 				msg.key = key & 0xFFFF;
+				if (key & KEYMSG_FIRSTDOWN) msg.flags |= key_flag_first_down;
 				if (keystate(VK_CONTROL)) msg.flags |= key_flag_ctrl;
 				if (keystate(VK_SHIFT)) msg.flags |= key_flag_shift;
 				return msg;