Published 28 Jun, 2022

How to clear the keyboard buffer?

Category Linux
Modified : Feb 01, 2023

Linux operating systems are jam packed with features, there are lots of command line tools avilable inside and in the package repository. You'd always find a program for most of your use cases. In this post you'll learn about some of the important features the linux family of operating systems have to offer.

There are 1 suggested solutions in this post and each one is listed below with a detailed description on the basis of most helpful answers as shared by the users. I have tried to cover all the aspects as briefly as possible covering topics such as Linux and a few others. I have categorized the possible solutions in sections for a clear and precise explanation. Please consider going through all the sections to better understand the solutions.

Solution 1

You must indicate which type of application : terminal (POSIX syscall, curses, or stdio API), Qt, Gtk…

If it is a terminal (syscall) you can use the select syscall and verify if something is available on the standard input, and while it is true, read it.

It is more a programming question.

ASCII stupid question, get a stupid ANSI!
Tags: Linux