Added keymask features to handler base class

Added keymask features to handler base class
Added an example