Page MenuHome

Patch to fix keyboard sensor from blocking quit game key binding
Closed, ResolvedPublicPATCH

Description

Patch for: T31671

The keyboard sensor looks for the escape key, and if it is used by the sensor it will call HookEscape() blocking the escape key from exiting the game. Since Moguri's change the user can now specify what key exits a game, however, the keyboard sensor still only looks for the escape key. Meaning that if a keyboard sensor uses the escape key, exiting is blocked regardless of what key binding is used to exit the engine.

This patch passes the assigned exit key to the keyboard sensor during conversion, so that it calls HookEscape() only when the assigned exit key is used by the keyboard sensor.

Event Timeline

Hey Daniel, can you take a look at that?

Overall looks good to me. Not sure if the white space changes in SCA_KeyboardSensor.h were intentional or not.

Sorry about that. The white spaces aren't intentional. The only change I made to SCA_KeyboardSensor.h was the addition of the exitKey parameter.

Blender development, SVN and patches are still all very new to me. I'll make sure not to include unintentional white space changes in the future. I'll upload a version of the patch without white space changes when I get home. Cheers for looking at it!

Attached a version of the patch without the accidental white space changes!

Committed as r47700. Thanks for the fix!

Mitchell Stokes (moguri) changed the task status from Unknown Status to Resolved.Jun 10 2012, 9:59 PM