Skip to content

Commit

Permalink
event type is last char, not always 15th char
Browse files Browse the repository at this point in the history
length of decoded data can vary, so let's make check correct to prevent errors in case of copy-pasting this line of code
  • Loading branch information
unxed authored Nov 24, 2022
1 parent 71cc6d4 commit 140abf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/platform/terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ ParseResult TermIO::parseEscapeSeq(GetChBuf &buf, TEvent &ev, MouseState &oldm)
const char* out = s.c_str();

KEY_EVENT_RECORD kev {};
if (strcmp(out + 14, "K") == 0 )
if (strcmp(out + s.length() - 1, "K") == 0 )
{
kev.bKeyDown = 1;
memcpy(&kev.wRepeatCount, out, sizeof(kev.wRepeatCount));
Expand Down

0 comments on commit 140abf5

Please sign in to comment.