If you are making a game where the object has a built in behaviour, there should be a behaviour event which would suit the case better
Or you could use the on touch end functions.
If you have representations of the keys in game you can use a system like: