CodeCafeOpenShiftGame / PodEscape

Endless runner of a pod trying to escape from a project being deleted.
https://podescape.io
Apache License 2.0
29 stars 16 forks source link

Unable to use Ctrl+Enter to play #73

Open mohammedtouheedpatelgithubcom opened 3 years ago

mohammedtouheedpatelgithubcom commented 3 years ago

Describe the bug A clear and concise description of what the bug is. redhat

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context I have checked my keyboard other functionalities like space and wad are working fine only ctrl+play isn't working not sure if it's a bug or not.Or maybe it's Functionality are missing.

rluders commented 3 years ago

All right, I actually checked this one. It seems that the canvas doesn't get the focus when we open the page. So, we probably need to add something to set it to the canvas by default when the page loads, so it can capture the keyboard events.

In order to simulate what I'm saying:

  1. Open the podscape.io
  2. Try to press Ctrl + Enter (it should not work)
  3. Now, click in any place of the game canvas
  4. Try to press Ctrl + Enter (it should now work)

We could probably add some javascript to the export template:

document.getElementsByTagName('canvas')[0].focus()

And it should solve the issue.

mohammedtouheedpatelgithubcom commented 3 years ago

Yeah! You are absolutely correct.I too just checked now it is working.I found this luckily since my mouse wasn't working well.So I tried everything with keyboard.Thank you for your feedback @rluders .Yeah that may fix this issue.