This site requires JavaScript, please enable it in your browser!
Greenfoot back
JetLennit
JetLennit wrote ...

2017/8/30

Keyboard not working with HTML5

JetLennit JetLennit

2017/8/30

#
So, I haven't really been on in a while and when I tried to run one of my old games the keyboard didn't function. Am I doing something wrong? If I remember correctly the controls were either the arrowkeys or wasd. Here's the game Cheers!
Super_Hippo Super_Hippo

2017/8/30

#
In the applet version, you can see a green foot which - when you press run - changes into a message: "What is this room? Why am I here? Maybe you should should move me with the arrow keys". In the HTML 5 version, there is no foot and no message, movement doesn't work. You also can't pause the scenario. Music plays. I am not sure but it could be that the creation of the image isn't working because it is an old scenario and probably uses the java.awt.Color and java.awt.Font classes which are not supported anymore.
davmac davmac

2017/8/30

#
See previous discussion:
  • if you report a problem we need to know exactly what is causing it. Either the source code should be available (you can send it to us privately rather than publishing it, if you prefer) or you should be able to identify precisely what is not working.
  • use of AWT/Swing/JavaFX in scenarios is not supported at all (and won't be).
  • not all of the Java API is available. If you need particular classes/methods that don't seem to be available, you can request it here. The full API will probably never be supported, but a good subset should be available.
(Note, please try and figure out an issue yourself before resort to sending us the code - in particular make sure you don't use Swing/AWT, and see if you can isolate where the scenario stops).
Yehuda Yehuda

2017/8/30

#
By that scenario I was brought straight to the HTML5 version, which doesn't work. By other scenarios (I think, you said HTML5 might become default) I'm brought to the Applet version, which does work. So I'm brought to the not default, not working version of a scenario.
Super_Hippo Super_Hippo

2017/8/31

#
He linked the HTML 5 version (with the ?js=true in the end). That's why you are coming straight to that one.
davmac davmac

2017/8/31

#
By that scenario I was brought straight to the HTML5 version, which doesn't work. . So I'm brought to the not default, not working version of a scenario.
As Super_Hippo also pointed out, the link was to the HTML5 version. If you follow a link to the HTML5 version then you will see the HTML5 version. Before transitioning to HTML5-as-default we will remove all failed HTML5 conversions. (The conversion process originally still generated a HTML5 version even if an error was detected during conversion. That's no longer the case).
Yehuda Yehuda

2017/8/31

#
I forgot this is his link that I'm going through.
danpost danpost

2017/8/31

#
Just uploaded a scenario through Google Chrome and keyboard actions were not available. Then, uploaded it again using IE, where keyboard actions worked.
Yehuda Yehuda

2017/9/1

#
Doesn't the uploading go from the scenario. How do you upload using a specific browser? (By changing the computer default browser?)
danpost danpost

2017/9/1

#
Yehuda wrote...
How do you upload using a specific browser? (By changing the computer default browser?)
Yes. That is what I did.
You need to login to post a reply.