That does the trick perfectly.
String key = Greenfoot.getKey();
if (key != null)
{
if ("a".equals(key))
{
if (getRotation() == 180) move(1); else setRotation(180);
}
// other keys coded here
}is (isTouching(Door.class))
{
//do something
}