How to wire a three-pin on-off-on switch for reading input? I would like to read the output of an on-off-on switch with my Leonardo board, but I have very little knowledge of electronics and don't know how to wire it up.
This is the switch in question: E-Switch 200MSP4T1B1M1QE
The switch has three pins. Generic three-pin SPDT wiring diagrams I've found suggest that the two outer pins should be connected to separate lights and the middle pin should be connected to the power source. Those lights also have a ground connection.
I don't want to power anything in a literal sense, I only want to have the Leonardo read the output of the switch. The end goal is to have the two ON positions read as separate button presses (eventually using a joystick library, in case that changes how the switch needs to be wired).
My questions are:

Is the above wiring example correct for my use case?
Is the output of the switch considered digital or analog?
Is a wire from the switch to GND not required?

One final note - I'm not using a breadboard, but connecting the wires directly from the switch to the board.
I suggest this simple circuit:



simulate this circuit &ndash; Schematic created using CircuitLab
Set both inputs to INPUT_PULLUP. If the input reads LOW, that means it has been grounded by the switch.

Edit: Per Duncan’s request, here is the alternative circuit with the polarities inverted. With the switch’s common connected to Vcc, the inputs should be set to INPUT_PULLDOWN. However, most Arduinos do not support this mode, for lack of internal pull-downs. Then one has to use external pull-downs instead, and set the pins to INPUT.



simulate this circuit
With this circuit, a pin reads HIGH when it is connected to +5V by the switch.