Added usage of command state for mouse up- and mouse down events.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>