Add support for pen mode