mirror of
https://github.com/kiedtl/fire.git
synced 2024-11-15 20:46:38 +00:00
main: handle q, ctrl+d; add exit point
This commit is contained in:
parent
d1ad444cd0
commit
da742e282d
16
main.c
16
main.c
@ -91,19 +91,25 @@ main ( int argc, char *argv[] )
|
|||||||
|
|
||||||
if (e.type == TB_EVENT_KEY)
|
if (e.type == TB_EVENT_KEY)
|
||||||
{
|
{
|
||||||
|
switch (e.ch) {
|
||||||
|
case 'q':
|
||||||
|
goto cleanup;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch (e.key)
|
switch (e.key)
|
||||||
{
|
{
|
||||||
case 0x03:
|
case TB_KEY_CTRL_C:
|
||||||
cleanup(&buf);
|
case TB_KEY_CTRL_D:
|
||||||
exit(0);
|
goto cleanup;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// perform cleanup
|
cleanup:
|
||||||
cleanup(&buf);
|
cleanup(&buf);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user