Now works with both keyboard and application input