application game and keyboard help

hi

I am trying to make a game for the 4kb contest

but I cant get the keyboard to work. I have only

programmed applets before and it seems theres not the

same way to use a keyboard in applications?

does anyone know what to do to get keyboard input

in an application? the game uses fullscreen in java 1.4.1

thanks in advance.

[373 byte] By [zuloa] at [2007-9-28 6:21:50]
# 1
Well, the obvious answer is to have someone type into an object that accepts keyboard input like a textbox and hit a button when all inputs are done.Would you be a little more specific on what you want please?
morgalra at 2007-7-9 17:33:40 > top of Java-index,Other Topics,Java Game Development...
# 2
the problem is the application dont useany objects like textboxes. Only a frame and then itdraws stuff.Maybe the frame can have input?
zuloa at 2007-7-9 17:33:40 > top of Java-index,Other Topics,Java Game Development...
# 3

There is NO difference between key input in an applet, and key input in an application.

3 bits of code is all you need

1)

class SomeClass implements KeyListener

2)

addKeyListener(this);

3)

public void keyPressed(KeyEvent e) {}

public void keyReleased(KeyEvent e) {}

public void keyTyped(KeyEvent e) {}

Abusea at 2007-7-9 17:33:40 > top of Java-index,Other Topics,Java Game Development...