If you need an example of how to use the Java Robot class in a Scala program, here's a quick one. As unusual as it might seem, this example lets your Scala program log back into a Mac OS X computer after you've been logged out, typically by a screensaver.
First, here's the Scala source code to demonstrate the Robot class: