Overhaul USB HID for Leonardo and Micro

This pull request includes the features from pull request 1488 and pull request 1391. I've somewhat overhauled the code to better match the surrounding code and a few features.

I've also added code examples for the less discoverable features.

If this pull request isn't "right" yet, I'd love feedback so I can improve it.
Good catch. Thanks.


On Tue, Dec 09, 2014 at 10:09:42AM -0800, Nico wrote:
> > @@ -513,6 +797,13 @@ size_t Keyboard_::write(uint8_t c)
> >  	return p;              // just return the result of press() since release() almost always returns 1
> >  }
> >  
> > +size_t Keyboard_::writeKeycode(uint8_t c)
> > +{	
> > +	uint8_t p = pressKeycode(c);		// Keydown
> > +	uint8_t r = releaseKeycode(c);		// Keyup
> > +	return (p);					// just return the result of pressKeycode() since release() almost always returns 1
> > +}
> > +
> 
> You can remove the r here
> 
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/arduino/Arduino/pull/1803/files#r21547689

--