public static void main(String []args) throws IOException, InstantiationException, IllegalAccessException, ClassNotFoundException {
CaptureDemo demo = new CaptureDemo();
demo.start(ServiceLoader.load(ch.blackspirit.graphics.CanvasFactory.class).iterator().next());
}
public void start(ch.blackspirit.graphics.CanvasFactory factory) throws IOException {
ControllerEnvironment controllerEnv = ControllerEnvironment.getDefaultEnvironment();
Keyboard keyboard = null;
for(Controller controller: controllerEnv.getControllers()) {
if(controller.getType() == Type.KEYBOARD) {
keyboard = (Keyboard)controller;
break;
}
}