Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handle User Input with Raphael

I'd like to write a simple game using the Raphael Javascript library, but one question is sticking in my mind.

How does one handle keyboard input? I've looked through the reference material and haven't found any reference to this. Can you simply pass it the standard JavaScript keypress methods?

like image 313
the_e Avatar asked Nov 05 '22 19:11

the_e


1 Answers

Are you talking about Raphaël—JavaScript Library.

If yes, just check the source of the provided samples.

e.g.

IChart Sample

And you see they use normal js events (onmousemove,onmouseup,mousedown,mouseup,mouseover,...)

like image 58
jitter Avatar answered Nov 12 '22 13:11

jitter