Game Logic: getExitKey

getExitKey()
  • Returns the keyboard key used to exit the game.

Return Type:

  • string
Sample Code

################## get the key used to exit the game  
  
# import bge

import bge
  
# get the exit key
quit_game = bge.logic.getExitKey()