Problem with PS/2 button detection routine
Hello everyone. I was hoping someone could help me with a program I am making that detects and prints out a message if the user presses a 1,2,3,4 or 5 on a ps/2 keyboard. The routine works (sort of). To get the "1" message to display the I need to hit the 1 key one time, to get the "2" message to display I need to hit the two key twice, the three key twice for "3", etc. I believe it has something to do with calling the function getkey 5 times, however I tried messing with the functions and whatnot and really haven't gotten anywhere. Would anyone have an idea why this isn't working? Any insight is greatly appreciated.


Comments
repeat c := kb.getkey ' evaluation using if/case/etc if c == '1' ...Also, calling a method from within itself is a really bad idea, eventually you'll run out of stack. As you are in a repeat construct you might as well use next.