Fixed keyboard hook bug

The keyboard hook id was not properly saved so it was not properly
terminated on stop.
Implemented dragging

You can now drag with the mouse!