From 3cfea2815e3edfeb15fd7f0173957254babc7326 Mon Sep 17 00:00:00 2001 From: jonas Date: Thu, 27 Dec 2018 11:35:34 +0100 Subject: Added _EVENT_TERM to cInput _EVENT_TERM is returned when Cmd + C is pressed --- cInput.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cInput.cpp') diff --git a/cInput.cpp b/cInput.cpp index 2a6e11c..a862127 100644 --- a/cInput.cpp +++ b/cInput.cpp @@ -45,8 +45,11 @@ sInputEvent cInput::poll() return ret; read (STDIN_FILENO, &buff, 1); - - if (buff[0] == '\x1B') //Escape sequence + if (buff[0] == 3) { + // User pressd Ctr+C + ret.type = _EVENT_TERM; + } + else if (buff[0] == '\x1B') //Escape sequence { read (STDIN_FILENO, &buff, 5); if(buff[0] == '[') -- cgit v1.2.3