Create global variable 'state'
when right or left key is down --> set 'state' to 1
else --> set 'state' to 0
state=1 --> do a charging
charging is complete..
sub event: on release key left --> jump to left
sub event: on release key right --> jump to right