Link to W. G. Scott's web page (off site). Use of the script below is explained in that link. Briefly, the PowerMate driver must be installed and configured as explained in detail in that link before this script will work.
Pymol lets you define some keys (the function keys, ALT-[A-Z,0-9], left, right, up, down, etc) as pythonic pymol commands, like those below. I chose 2 degree increments for rotation and 0.5 for translations because these values give a visually smooth response, but change this to suit your own taste. Type
help set_key
in pymol for more information.
The code below dynamically assigns functions to the four programmed keys by running python scripts in pymol to reset the key bindings. Clicking the Powermate dial to activate the toggle function (assigned to F5) allows you to toggle cyclically through dial functionality options, thus giving you three sets of rotations and translations.
In other words, turn the dial right or ..→