Every time one of the keys of the code is pressed append it to a text variable.
Do a system compare with right(length of code) equal to code to see if it's a match.
So say the code is udlra.
u for Up, d for Down, a for A, etc.
You events (-input events) would look like this:
Global text variable 'value'=""
System| compare right(value, 5) = "udlra"
---- Enable Cheat