All key sensor connected to script connected to actuators?

Since I don’t have experience in Python but I do have some programming background I made a little “description” on what I want to do.

There is a main object with some Boolean variables in it. There is a Keyboard sensor set on All Keys that connects to a script that connects to other objects’ actuators.
If a specific key is pressed and some of the variables are okay then it triggers the correct actuator once. I was experimenting with that but whenever I was able to trigger the actuator it triggered like 10 times regardless of the setup on the keyboard sensor.

What I had in mind:


if (keypressed == BACKSPACEKEY)
    then
        if (N==False && Le1==False) then trigger actuator once in Object1
    else
        if (E==True && Le1==True) then trigger actuator once in Object2

if (keypressed == EKEY && E==False && Le1==False) then trigger actuator once in Object3

And so on...

How can I do that in Python? How can I detect if Backspace is pressed?