
setExitKey(key)
- Sets the keyboard key used to exit the game.
key:
- The keycode for the keyboard key.
- Type: Interger or bge.events
Note:
- You don't need a keyboard sensor to use setExitKey(key).
- Link to Key Codes

Sample Code
################## set the key used to exit the game
# import bge
import bge
# set the exit key
# Q key = 113 = bge.events.QKEY
bge.logic.setExitKey(bge.events.QKEY)