public class Example extends JApplet
{
public int inkey()
{
int keyScanCode=0;
//THE CODE I NEED TO ACCEPT KEYBOARD INPUT
//AND RETURN THE KEYCODE OF THE KEY PRESSED
return keyScanCode;
}
public void paint(Graphics g)
{
.
.
.
}
//AND THE REST OF THE APPLET
}
//MUST BE IMPLEMENTED LIKE THIS:
public class Inkey()
{
BLAH;
BLAH;
BLAH;
int scanCode=inkey();
BLAH;
BLAH;
}
//or something similar
Java INKEY$
My current games in JAVA all use the mouse and I'm trying to implement key listeners. Unlike mouse and action listeners I cant get them to work for some reason. I was wondering if anybody could submit their key listener code as mine WON'T WORK!
>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Ilthigore-
<<<<<<<<<<<<<<<<<<<<<<<<<<<<
[edited by - ilthigore on August 12, 2002 11:55:49 AM]
>>>>>>>>>>>>>>>>>Ilthigore<<<<<<<<<<<<<<<<<
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement