added Direction to implement key handling in smartmode