Describing Moment in a Sentence [closed]

Is this sentence correct?

I want to execute the/a part of my code for once, and exactly the moment when the key is pressed and a clicked is occurred.

Also, what kind of grammatical structure is used above?


You seem to want to say:

I want to execute a part of my code once, and at exactly the moment when the key is pressed.