Hi, not sure about pd, but in supercollider you can call a .grab() method on HID objects that will block other software, even X, to have access to them.
HTH, renato