your trace-scan approach doesn't seem the best way to accomplish this task.
Let me understand what exactly you are asking for.
A player walks up to a locked door. There is a keypad next to it with 9 digits on it.
Do you want the player to press "enter" next to it and a 2D key-pad comes up where you enter the code, and the door opens?
Or do you want to be able to click on the keypad in a 3D view?