Hello,

I have developed a small project where the player has to guess a number from 1-9.

I can enter the code using the keyboard numbers from 1 to 9 but nothing happens when pressing the numerical keypad numbers.

I have the num_lock on. Why does this not work?


I am using key_pressed and the scan code as below
///////////////////////////////////////////////////////////////////////
var answer;
var correct_answer;
answer = int(random(9)) + 1; //choose number 1-9
correct_answer=answer+1;//this is for the corresponding scancode

var guesses=3;


action check_key
{
while(guesses>0)
{
if(key_pressed(correct_answer))
{
//access granted
//trigger door open
}
else
{
//buzzer
//reduce guesses by 1
}
wait(1);
}
}
///////////////////////////////////////////////////////////////////////



Does the keypad not work as the keypad values are

1 = end
2 = cursor down
3 = page down
4 = cursor legt
5 = null
6 = cursor right
7 = home
8 = cursor up
9 = page up


would appreciate an explanation

thanks,

Rob