Maverick139
Maverick139

Reputation: 1

Implementing 'q' interrupt enabled loop exit

I'm trying to implement a loop that is exited solely by pressing the 'q' key, how do I go about it.

This is for a shell I'm making, I've tried various input methods like getchar(), getch() and the expanded code of kbhit() {as kbhit() is not available in linux.}

The recurring fault I've been getting is that each time the loop runs an iteration, any of the input functions HALTS the loop execution and waits for the user input. Here, I'm trying to exit the loop if and when the 'q' key is pressed.

Thanks in Advance :)

Upvotes: 0

Views: 43

Answers (0)

Related Questions