Blender Game Engine toggle FullScreen with script
I test it and yeah it enter 'FullScreen' and then deactivates.

I assume that you was using a always sensor wich will trigger twice combined with a mouse click sensor.

To make it work the logic:



The script:

from bge import logic, render

left_click = logic.getCurrentController().sensors['MouseLC']
mouse_over = logic.getCurrentController().sensors['MouseOver']

if mouse_over.hitObject and left_click.positive:
    if render.getFullScreen():
        render.setFullScreen(False)
    else:
        render.setFullScreen(True)


If you want bge in front all instuctions.

import bge

left_click = bge.logic.getCurrentController().sensors['MouseLC']
mouse_over = bge.logic.getCurrentController().sensors['MouseOver']

if mouse_over.hitObject and left_click.positive:
    if bge.render.getFullScreen():
        bge.render.setFullScreen(False)
    else:
        bge.render.setFullScreen(True)


if you dont want left_clikc and mouse_over

import bge

if bge.logic.getCurrentController().sensors['MouseOver'].hitObject and bge.logic.getCurrentController().sensors['MouseLC'].positive:
    if bge.render.getFullScreen():
        bge.render.setFullScreen(False)
    else:
        bge.render.setFullScreen(True)