If you want them to be able to use their keyboard directly, then the "easiest" way would be to use the Text Input object. Since it's just numbers though, I suggest that you make an on-screen number pad that the user can click.
There's a template in the Example Browser called Code Panel.