Neither sensor needs its own class.
The first can use a digital input, the ultrasonic (which won't do what you want) uses an analog input.
Think of the inductive sensor as a switch - it is either on or off. Just using a transistor, not an actual switch.
How about sensing your screw head with an actual
lever-type limit switch instead? Or a magnetic reed switch?