Handle window (de)activation, demonstrate handling key presses.