keydown not working with py3.codeskulptor

337 Views Asked by At

This problem seems to have happened recently and I don't know what to do.

Running latest Chrome on my Windows 8.1 machine. If you run this code in codeskulptor.org, you'll see that the gui window displays keys as they are pressed down: http://www.codeskulptor.org/#user47_g8KWuSA3as_0.py . But running it in py3.codeskulptor.org, the running window doesn't register any key presses: https://py3.codeskulptor.org/#user305_M3ZKRfZXyN_0.py .

Now, you'll notice that py3.codeskulptor uses https and codeskulptor doesn't, but, as I said, the problem wasn't there initially when I first transitioned to using it from the regular codeskulptor.org.

I have tried running it in an "incognito window". I have tried to disable all my extensions. I have tried to turn off "safe browsing". No other browser (Firefox) I have seems to support codeskulptor, so I can't check there.

1

There are 1 best solutions below

6
On

Try by printing the key like this to see if the key event works: https://py3.codeskulptor.org/#user305_QNEkSkKm9wQUG8R.py Do not forget to click on the canvas, else key events are ignored.

By the way you can use exactly the same code with both version of CodeSkulptor by simply change the beginning of the URL, like this: http://www.codeskulptor.org/#user305_QNEkSkKm9wQUG8R.py

If Chrome doesn't work yet, try with Firefox. Normally CodeSkulptor works, maybe slowly, but it works.

You can also use SimpleGUICS2Pygame, it is a standard Python package that implements specific modules of CodeSkulptor to run on your computer.