The idea is to have a boolean for each kind of key you need to manage. When a key is pressed, set its boolean to true. When it is released, set it to false. Check the state of the booleans to know what to do.
Use the functions, not the variables in draw().