implement input modes