If by example you mean capx, I don't have the capx with me but I used the following:
* objects: mouse, keyboard, spritefont, function, 3 text objects and 1 other sprite
* each number of numpad pressed or each click on spritefont is append in temptext (invisible) and runs a function to copy the digit and the "_" for digit left while len(temptext) is not egal to max lenght of your key
* once temptext lenght = max lenght, a function compare if temptext= keycode and unlock else display "access denied" and restart the user key