0

I'm unsure if this is the cause of Python or Curses. Whenever a user presses a key, that input is saved into a "queue". The next time the program asks for user input, it will accept whatever is in that queue. I'm wondering if there is a way to disable this, so that whenever the program asks for input, it waits for a user to give input rather than use whatever is in the queue.

Here's my code: https://github.com/lucash-diskkun/curseslibtcod/blob/master/norbak/Norbak.py

Lucas H
  • 3
  • 2
  • Welcome to Stack Overflow. To help you get the best result on Stack Overflow, see how to ask good [questions](https://stackoverflow.com/help/how-to-ask). Make sure your question covers these 3 elements: 1. Problem Statement 2. Your Code (it should be [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) 3. Error Message (preferably full Traceback to help others review and provide feedback). Sometimes the same question may have already been asked. Make sure your question is not a [duplicate](https://stackoverflow.com/help/duplicates) – Joe Ferndz Aug 23 '20 at 19:56
  • I'm not sure if you are a bot or something but I've followed these steps. 1. Problem statement: check. 2. My Code: N/A. 3. Error Message: N/A. And I checked for duplicates. Let me know if someone has already asked the question! – Lucas H Aug 23 '20 at 22:34
  • @Lukas, I am not a bot. Can you please share whatever code you have written that creates this problem. – Joe Ferndz Aug 23 '20 at 23:31
  • @JoeFerndz ah sorry, I've edited in my code. – Lucas H Aug 24 '20 at 00:05

1 Answers1

0

curses.flushinp()

Flush all input buffers. This throws away any typeahead that has been typed by the user and has not yet been processed by the program.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105