added "mask" key check on setPen as well

Signed-off-by: Nicholas Tan Jerome <nicholas.jerome@kit.edu>