Properly distinguish between keyboard and controller events