Is there a way with pygame to get keyboard input when the window is minimized?
<p>Title says it all. Is there a way with pygame to get keyboard input when the window is minimized? </p>

<p>Thanks.</p>

<p>Yes, although you have to have it focused.</p>

<pre><code>import pygame
pygame.init()

pygame.display.iconify()

while 1:
    for event in pygame.event.get():
        if event.type == pygame.KEYDOWN:
            print(event.key)
</code></pre>

<p>Otherwise it seems to not be possible according to <a href="http://stackoverflow.com/questions/9815995/read-console-input-using-pygame">this answer</a> and <a href="http://stackoverflow.com/questions/32567480/use-keyboard-without-calling-pygame-display-set-mode">this answer</a></p>

python pygame