Skip to content

Commit

Permalink
Merge pull request #127 from yixy-only/master
Browse files Browse the repository at this point in the history
fix:标记按键按下时第一次发送的down消息
  • Loading branch information
wysaid authored Jul 29, 2023
2 parents 1af93ed + fc92071 commit 392594b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ege.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions src/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 392594b

Please sign in to comment.