>Thanks. but how to define a device ID? the help file doesn't say.
Assuming that the help files are your only resource is ill-advised.
Even if you weren't enterprising enough to search the website
for discussions of this topic, you have a nice tutorial on working
with live input as well as the online reference manual page for
the jit.qt.grab and jit.dx.grab objects.
This advice to beginners is given with some regularity: DON'T
assume that the help file contains everything you need to know
about the messages or attributes of a given object. DO assume
that it's on the Reference manual page.