diff options
author | jonas <himself@jonasgunz.de> | 2018-12-27 11:35:34 +0100 |
---|---|---|
committer | jonas <himself@jonasgunz.de> | 2018-12-27 11:35:34 +0100 |
commit | 3cfea2815e3edfeb15fd7f0173957254babc7326 (patch) | |
tree | b839575b6cbb0013b84e2ea4bb189193b807410f /cInput.cpp | |
parent | f3772d321faae1cd72e577cea5b9fc75accd0700 (diff) | |
download | termgl-3cfea2815e3edfeb15fd7f0173957254babc7326.tar.gz |
Added _EVENT_TERM to cInput
_EVENT_TERM is returned when Cmd + C is pressed
Diffstat (limited to 'cInput.cpp')
-rw-r--r-- | cInput.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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] == '[') |