Pk_tether
PK_Tether – Tethering Software for Pentax DSLR Cameras
Officially supported bodies: Pentax k-x, K7, K5, k-r, K20D, K10D, K200
People have gotten it to work with K-30 and K-50. Mixed results on these. Supposedly the developer has a version that partially works with the K-3 but it has not been released.
PKTriggerCord
http://pktriggercord.sourceforge.net/pktriggercord_commandline.html
Officially supported: K20d, K10d, GX10, GX20, K-X, K200D, K-7, K-r, K-5, K-2000, K-m, K-30, K100D, K110D, K-01, K-5II, K-5IIs.
PKTriggerCord is open source and there are variants out there. Search the forum.