I have these to add a rotary encoder + switch to a slot on a mechanical keyboard (specifically the Drop/OLKB Planck keyboard). They work great programming my board with QMK. Just make sure the encoder is set up correctly in QMK (mine initially moved twice as far as it should rotate for a click). The good thing about them is that they're relatively short, so they don't stick out too far above the rest of the keycaps. I ended up 3D printing a pen for myself, but it's a standard size so finding the right pen should be easy.
Vacuum cleaner KARCHER VC 3, yellow
176 Review
Universal Rotary Cam Selector Latching Switches - VictorsHome Changeover Switch LW28-32 With 3 Positions, 12 Terminals For 690V, 32A Capacity
9 Review
5Pcs 19Mm 12V 24V Waterproof Latching Push Button Switch With Wiring Harness And LED Indicator Light, Pre-Wired SPDT Self-Locking 4 Pin Marine Metal Switch For Boats Cars Trucks (Blue)
22 Review
Adjustable AC Current Sensing Switch: SZC23 No AL-CH Model, 0.2A-30A Range
14 Review