title: Python keyboard library arrow keys problem
body: <p>I was writing a script, which takes a screenshot and decodes specific key presses in the name of the image as seen below.
  My problem is that when I press the left keyboard arrow, also the number 4 is pressed.
  I can't find anything on google or in the documentation of the keyboard library. I am using Windows and Python 3.6.5</p>
  <pre><code>(75,)
  left arrow pressed
  (5, 75)
  4 pressed
  </code></pre>
  <p>The same thing happens with the down arrow, but with the number 3.</p>
  <pre><code>(80,)
  down arrow pressed
  (3, 80)
  2 pressed
  </code></pre>
  <p>Code:</p>
  <pre><code>from PIL import ImageGrab
  import keyboard  # using module keyboard
  import time
  
  keys = [
      &quot;down arrow&quot;,
      &quot;up arrow&quot;,
      &quot;left arrow&quot;,
      &quot;right arrow&quot;,
      &quot;w&quot;,
      &quot;s&quot;,
      &quot;a&quot;,
      &quot;d&quot;,
      &quot;1&quot;,
      &quot;2&quot;,
      &quot;3&quot;,
      &quot;4&quot;,
      &quot;q&quot;,
      
  </code></pre>
  <p>&quot;e&quot;,
  &quot;f&quot;
  ]</p>
  <pre><code>if __name__ == &quot;__main__&quot;:
      while True:
          code = []
          try:
              for key in keys:
                  if keyboard.is_pressed(key):
                      print(keyboard.key_to_scan_codes(key))
                      print(f&quot;{key} pressed&quot;)
                      code.append(1)
                  else:
                      code.append(0)
                      
              if keyboard.is_pressed('esc'):
                  print(key + &quot; pressed&quot;)
                  break
                  
              c = &quot;&quot;.join(map(str, code))
              snapshot = ImageGrab.grab()
              save_path = str(int(time.time()*1000)) + &quot;-&quot; + c + &quot;.jpg&quot;
              snapshot.save(&quot;tmp\\&quot; + save_path)
  
          except:
              break
  </code></pre>