Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Applet KeyListener Not responding  (Read 2759 times)
0 Members and 1 Guest are viewing this topic.
Offline MonsterOfCookie

Junior Devvie

Medals: 2


« Posted 2011-07-04 10:09:16 »

Hey All,

I have just put my game live ( 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?



Offline ReBirth
« Reply #1 - Posted 2011-07-04 10:39:47 »

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();

Offline Z-Man
« Reply #2 - Posted 2011-07-04 16:21:57 »

I don't know a lot about using Applets but you could try calling requestFocusInWindow() on the applet.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline philfrei
« Reply #3 - Posted 2011-07-05 08:12:29 »

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 <Enter> key not working on your Facebook game. But I suspect it wasn't due to this particular lack of focus issue, as the <Left> and <Right> 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!

music and music apps:
Offline MonsterOfCookie

Junior Devvie

Medals: 2


« Reply #4 - Posted 2011-07-05 08:59:52 »

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.

Pages: [1]
  ignore  |  Print  

EgonOlsen (76 views)
2018-06-10 19:43:48

EgonOlsen (56 views)
2018-06-10 19:43:44

EgonOlsen (76 views)
2018-06-10 19:43:20

DesertCoockie (256 views)
2018-05-13 18:23:11

nelsongames (156 views)
2018-04-24 18:15:36

nelsongames (155 views)
2018-04-24 18:14:32

ivj94 (896 views)
2018-03-24 14:47:39

ivj94 (157 views)
2018-03-24 14:46:31

ivj94 (809 views)
2018-03-24 14:43:53

Solater (173 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!