as separate states from whether the button is depressed, so there would be three states (button down; button up with finger on it; button up with no finger on it).
you could probably do this using a sensor for capacitance. in theory, with a depressable joystick, this could provide full 3D controls on one joystick (with left right forward back on the stick normally, stick pressed in for down, and finger lifted off of stick for up)