Check out the IsControlJustReleased( line

The second param 311 is the key, you can find them in the docs