Input method and apparatus