Programming help - Tilt switches as keyboard

Paul, I would like one character when the lever is pressed

I think you mean that you would like one character when the lever becomes pressed as suggested by PaulS

Note the subtle difference.

Look at the StateChangeDetection example in the IDE.