BGE python help, audio raise function

I have the correct imports, and I’ve tried several different varients of this code… I have a sensor detecting the mouse clicking, and that still raises this error:

TypeError: ‘SCA_MouseSensor’ object is not iterable

def VolumeUp():    
cont = bge.logic.getCurrentController()
    sensor = cont.sensors["LeftButton"]
    for mouse.status in sensor:
        if status == bge.logic.KX_INPUT_JUST_ACTIVATED:
            vol = 1
            print ("before", vol)
            vol = vol + 1
            print ("after", vol)

How to say this… you see, the SCA_MouseSensor object is not iterable, that’s basically it.

Probably not very useful uhh? OK, see this line: for mouse.status in sensor:

Here you are trying to iterate the sensor object.Probably someone will come with an actual snippe of code of what you want to do, if not, just leran Python and read the API.

reference:
https://www.blender.org/api/blender_python_api_2_78a_release/bge.events.html
https://www.blender.org/api/blender_python_api_2_78a_release/bge.types.SCA_PythonMouse.html#bge.types.SCA_PythonMouse

no logic mouse sensor needed, just always with true triggering.


bge import logic, events

if logic.mouse.events[events.LEFTMOUSE] == logic.KX_INPUT_JUST_ACTIVATED:
   # RUN CODE #