Applet KeyListener Not responding

Hey All,

I have just put my game live (http://apps.facebook.com/beta_max) but I have had reports from people that key presses aren’t being registered. I have found someone I work with who has had the issue and it was resolved by clicking off the applet and back on again. Thing is, it doesn’t seem consistent with OS/Java Plugin Ver/Browser, as I have seen people on Linux/Mac/Windows all experiencing it…

Anyone else found this?

Cheers

Cookie

Has tried requestFocus() on the applet? I goggled it and someone suggested to use focus() of javascript


<script type="text/javascript">
	onload = function()
	{
		document.getElementsByTagName( "applet" )[0].focus();
	}
</script>

I don’t know a lot about using Applets but you could try calling requestFocusInWindow() on the applet.

Re your question: Has anyone else found this?

The answer is yes. I think it is a common thing, that keystrokes are not registered by an Applet until the Applet has the focus. I’ve certainly run across it in my first attempts at applets. The previous answers on this thread should do the trick.

I also had that issue with the key not working on your Facebook game. But I suspect it wasn’t due to this particular lack of focus issue, as the and keys worked fine without requiring a mouse click.

But now it is working fine for me, so perhaps you have dealt with the issue successfully!

The applet has focus because you have to click on it to start…

Then click again in them menu

So not entirely convince that is the solution.