title: How to check whether up and down button is clicked or not in native C
body: <p>I am creating a little shell which executes linux bash commands in ubuntu with fork and exec commands. I need to bring previous commands when up button is clicked and need to bring next command when down button is clicked as same as terminal. How can I do this with native C language?</p>
  
  <p>I mean I need to scan all the time like a listener in object oriented for up and down buttons.</p>