Fixed pressing keys while drawing with the pencil

Fixes #124.