Take a look at this section of the DirectRT manual: http://www.empirisoft.com/directrt/h...keypresses.htm.