Ending a programme w KeyboardStroke

What exactly will stop my programme?

The infinite loop - while(1);. Technically, it won't stop your program. What it does is prevent your program from doing anything useful. since the code is waiting for 1 to become false, which will never happen.