Space key to clear. Up, down, left, right is to move the pen. Open panel to switch color, close panel to close the panel. Change size to change the size.
Thanks to @TheScratchCreeper for a tutorial on how to use pen. All of the code is by @mrboss0205 or me.