How to write custom Form API elements for Drupal 7? In context of this question I wanted to ask - how to provide custom controls to use with Form API? Especially ones that needs to be exploded into javascript and at least one additional hidden field to make their GUI work.

I can find manuals for Drupal 6 easily enough, but somehow I can't spot ones for 7. I know I need to start with hook_element_info(), but hook's description for Drupal 7 points to a manual for Drupal 6.

Could anyone provide step-by-step instruction how to make it work?
Searching Google for "hook_element_info tutorial" brings up Create custom Form API elements with hook_element_info() in Drupal 7.

There is also the Examples for Developers project, which is included in the documentation at http://api.drupal.org. The Form API Example module implements hook_element_info() and contains a number of example elements in the form_example_elements.inc file.