kwyjibear 0 Posted May 26, 2007 Report Share Posted May 26, 2007 (I hope this is the right forum for this topic)Under the HTML DOM tutorial for Events, the first example doesn't seem to work right. It checks if the user is pressing the right mouse button by looking for a returned value of "2". If it doesn't get "2", it displays that the left button was pressed.However it always reported to me that I was pressing the left button. So I modified the code to see what numbers my mouse was returning and I came up with "1" for left, "0" for right (not "2") and "4" for the scroll wheel (the driver I have to use doesn't recognize a middle button). If these numbers are universal, then the code needs to be changed to reflect "0" for the right mouse button. Quote Link to post Share on other sites
justsomeguy 1,135 Posted May 29, 2007 Report Share Posted May 29, 2007 The numbers are not universal. It would probably be better to mention in the tutorial that detecting mouse clicks is on a per-browser basis, and some browsers (including Opera) do not even allow Javascript to receive events such as right-click. I'm not sure if the tutorial mentions that it is generally pretty useless to try and detect mouse clicks, but it pretty much is. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.