title: K_SPACE bug pygame
body: <pre><code>from pygame.locals import *
  import random
  import pygame
  from pygame.constants import K_RIGHT
  
  # Initialize the pygame
  pygame.init
  
  
  # create the screen
  screen = pygame.display.set_mode((800, 600))
  
  # background
  
  background = pygame.image.load('bg.png')
  # Title and Icon
  pygame.display.set_caption(&quot;Space Invaders&quot;)
  icon = pygame.image.load('ufo.png')
  pygame.display.set_icon(icon)
  
  # Player
  
  playerImg = pygame.image.load('player.png')
  playerX = 370
  playerY = 480
  playerX_change = 0
  
  
  def player(x, y):
      screen.blit(playerImg, (x, y))
  
  
  # Enemy
  
  enemyImg = pygame.image.load('alien.png')
  enemyX = random.randint(0, 736)
  enemyY = 50
  enemyX_change = 1
  enemyY_change = 40
  
  
  def enemy(x, y):
      screen.blit(enemyImg, (x, y))
  
  
  # Bullet
  
  # ready - you can't see bullet
  # fire - you can see bullet and it's moving
  bulletImg = pygame.image.load('bullet.png')
  bulletX = 0
  bulletY = 480
  bulletX_change = 1
  bulletY_change = 10
  bullet_state = &quot;ready&quot;
  
  
  def fire_bullet(x, y):
      global bullet_state
      bullet_state = &quot;fire&quot;
      screen.blit(bulletImg, (x+16, y+10))
  
  
  # Game Loop
  running = True
  while running:
  
      # Changing RGB of background
      screen.fill((0, 0, 0))
  # Background image
      screen.blit(background, (0, 0))
      for event in pygame.event.get():
          if event.type == pygame.QUIT:
              running = False
  
  # if keystroke is pressed check wheter its right or left
      if event.type == pygame.KEYDOWN:
          if event.key == pygame.K_SPACE:
              fire_bullet(playerX, bulletY)
          if event.key == pygame.K_LEFT:
              playerX_change = -3
          if event.key == pygame.K_RIGHT:
              playerX_change = 3
      if event.type == pygame.KEYUP:
          if event.key == pygame.K_LEFT or event.key == pygame.K_RIGHT:
              playerX_change = 0
  
  
  # bounds
      playerX += playerX_change
  
      if playerX &lt;= 0:
          playerX = 0
      elif playerX &gt;= 736:
          playerX = 736
  # enemy movement
      enemyX += enemyX_change
  
      if enemyX &lt;= 0:
          enemyX_change = 1
          enemyY += enemyY_change
      elif enemyX &gt;= 736:
          enemyX_change = -1
          enemyY += enemyY_change
  
  
  # bullet movement
      if bullet_state is &quot;fire&quot;:
          fire_bullet(playerX, bulletY)
          bulletY -= bulletY_change
  
      player(playerX, playerY)
      enemy(enemyX, enemyY)
      pygame.display.update()
  </code></pre>
  <p>I'm working on a tutorial project for begginers in PyGame. It is a copy of Space Inviders. When i'm pressing space nothing is happening, but when i press ctrl + shift + space it reacts as space, also after changing K_SPACE to K_LSHIFT or K_UP it is working but with other buttons it is not, I've tried changing &quot;fire&quot; and &quot;ready&quot; to True or False but it didn't fixed my problem</p>