Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

KeyListener Not Working In Internet Explorer

I made a small game

Play it here (http://sc4r.battleschool.frih.net)

It works fine in Firefox but the KeyListener doesn't work in Internet Explorer.

I include the applet with this code:

<!--[if !IE]>-->
<object classid="java:Shotgun.class"
type="application/x-java-applet"
id="ShotgunApplet" >
<!--<![endif]-->
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
id="ShotgunAppletIE" >
<param name="code" value="Shotgun" />
</object>
<!--[if !IE]>-->
</object>
<!--<![endif]-->

But also tried this:

<applet id='ShotgunApplet' code='Shotgun.class'></applet>

The full source code is available from here (http://sc4r.battleschool.frih.net/Shotgun.java)

Thanks in advance,
Frederik Vanderstraeten

-- Solved --

Had to remove the e.consume(); in mousePressed()
[1041 byte] By [StubruFreak] at [2007-11-11 7:50:21]