jsGameSoup takes over all keyboard input on page

7 views
Skip to first unread message

Danny Williams

unread,
Jul 31, 2012, 9:59:11 AM7/31/12
to jsgam...@googlegroups.com
So hopefully somebody still reads this group...

I'm attempting to use jsGameSoup on my project. It seems to be really simple and does exactly what I need, but I've run into a problem. jsGameSoup completely takes over keyboard input on the page I load it on. In other words, the user cannot enter data in other forms (like my game chat...). Even function keys and such are captured by jsGameSoup. 

How can I make jsGameSoup play nicely with the rest of the page?

Chris McCormick

unread,
Aug 8, 2012, 11:38:48 PM8/8/12
to jsgam...@googlegroups.com, Danny Williams
Hi Danny,

Inside jsgamesoup.js there is a bit where it attaches the keyboard
events to the entire document rather than the canvas. I had to do that
because attaching to canvas just didn't work on some platforms. You
could try modifying the code to attach to canvas instead and see how you
go on the platforms you are developing for. Search for 'AttachEvent' and
find the keydown/keyup events.

Cheers,

Chris.
--
http://mccormick.cx/
Reply all
Reply to author
Forward
0 new messages