Added support for keyboard input and changed the position calculations of jogdial's cap to be based on simple trigonometry.