if your using litec u can use inkeys check the manual for that(find).

if you want c++ you could try my solution to the same need:

http://www.coniserver.net/ubb7/ubbthreads.php?ubb=showflat&Number=232032#Post232032


See more code and crap @ www.neuroticnetworks.com