Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Vlad

Hi all!

We have a Facebook app done with ImpactJS. It happens with Chrome browser that after showing a FB dialog canvas loses key bindings. Trying to rebind them again with ig.input.bind does not help. The game does respond to mouse click, but not to key input.

Any ideas where the problem is?

1 decade ago by Hareesun

My guess, with Facebook. I could be totally wrong of course, but I think Facebook's new keyboard shortcuts things could be causing the problem.

1 decade ago by fugufish

can you provide us with the link to your app? We can help check/troubleshoot

1 decade ago by Ken

If you click on your game again, does it catch the keystrokes again? One thing I have noticed when dealing with iframed games is that sometimes the focus shifts to the parent, thus your game looses focus and does not catch the key strokes. I have found some success with using onBlur to check for loss of focus and then reset the focus to the game. It seemed to work fine in FF and Chrome but not IE9.

1 decade ago by Vlad

I found out what the problem is, and solved it. It was not just with Chrome, although Chrome was for some reason most sensitive to it.

The thing is, whenever canvas loses focus (even if you click outside of it), the game loses keyboard bindings. And clicking it back did not regain focus, so I had to force it on click, and effectively stop the game if it loses focus (or lest they die not knowning how to play again). Works across browsers.

In Facebook every little thing makes it lose focus: chat, notifications, blah.

Thanks for your help!
Page 1 of 1
« first « previous next › last »