BGE: Can I automatically switch to material view on run? I've recently been experimenting with the game engine and coming from exclusively using cycles there are a few things that I am trying to get used to.  The most annoying of which I find is that when I run the game it uses the same shading as the viewport.  This doesn't make sense to me since I am used to rendering being totally independent of viewport settings.

So, as I usually use solid shading in the viewport, if I want to see my materials I have to remember to switch to material viewport shading mode before hitting P.  Is there a way to have it automatically switch the shading mode to material when I run the game and back to solid (or whatever else it was) when I Esc. out?
You could split the Start/Stop keys into separate press/release actions... So P engages Material Shading then starts the game; and Escape stops the game then (re)engages Solid Shading.

The devil's in the detail of course, ie. typing exactly the right stuff into User Preferences » Input » 3dView » Object Mode P to start the game engine need only be changed from Press to Release, but the two compound shading actions are best done with two new entries.

Put wm.context_set_enum and space_data.viewport_shade in the first two boxes of both; then, to engage Material Shading with the first new entry, set the Value to MATERIAL and assign key P as Press; and to (re)engage Solid Shading with the second new entry, set the Value to SOLID and assign key Escape as Release.

I tested this out &amp; it works nicely but it's still a good idea to backup your hidden User Preferences file so you can reinstate it if things get messed up). Several blender.stackexchange threads cover this.

Also note that a key's standalone release action will be triggered if a combining modifier (Ctrl / Shift / Alt) is released first.

So modifiers need to 'lag' and be the last key up. Unless the modifier is an adapted normal key, in which case clean key release may require 'cover' from an invoked on-screen dialogue.