title: Python Keypressing - Printing list only when value changes
body: <p>I'm trying to do the following thing:</p>
  <p>Store keypress state in a list (False or True values) then if I press or unpress some key the list will be printed only if it's content changes and only once. (Keypress in this case)</p>
  <p>I tried checking W A S D keys:</p>
  <pre><code>import keyboard
  
  # List initializing
  list = [False, False, False, False]
  previous_list = [False, False, False, False]
  
  
  while True:
       list[0] = keyboard.is_pressed(&quot;w&quot;)
       list[1] = keyboard.is_pressed(&quot;a&quot;)
       list[2] = keyboard.is_pressed(&quot;s&quot;)
       list[3] = keyboard.is_pressed(&quot;d&quot;)
  
       if list != previous_list:
           print(list)
           previous_list = list
  </code></pre>
  <p>Can you guys help me discovering why isn't it working ?</p>
  <p>Thanks !!</p>