Sender: nobody@hpcvusn.cv.hp.com (Nobody - UID must be 99999)
Organization: Hewlett-Packard Company, Corvallis, Oregon USA
Lines: 3
Nntp-Posting-Host: hpcvxgs.cv.hp.com
The XMaskEvent function only works with core events. You cannot use it to get extension events. You should be able to use XCheckTypedEvent instead.
You may also want to consider using the standard X input device extension, rather than the HP-proprietary input device extension. The functionality is basically equivalent.