Ask coding questions

← Back to all posts
Turtle Input Left and Right Mouse Considered Same?
RLarge (4)

I have been working with turtle in the attached project, and I have a part where when you click with both "mouse buttons" (I use trackpad on chromebook which might be the problem but I will get to that) it shows a few options you can click on. The problem is I just want it to be the right mouse button, but this doesn't seem to work when I try it. The right mouse button should be 2 in the button parameter of turtle.onclick(func, button), but when I try this it doesn't work. I then decided to test this further and found out that if I set it to 1 (left mouse button) then it also counts when you press the right mouse button, even though it should only take input from the left mouse button (Sorry if this didn't make sense. If you need me to, I can explain it better and in more detail). I think this might be because I am using a track pad (lenovo chromebook), and the input doesn't know the difference between left and right on the track pad. If this is the case, how do we ask the repl devs to fix this? Again, if you need me to explain it better, please let me know, and I will do that.

Comments
hotnewtop
AndrewMarkarian (21)

@RLarge Before you can do anything, you have to fix all errors.

You see what you have on line 22? You need to say what happens if

if positive == True and a < 0:

You put a colon there. That means it is being defined, and the next indented code belongs to it. If you don't want that line, delete that line. If you do, add what it will do. If you don't do anything, it will still mark it as wrong. I know that doesn't answer your question, but you need to fix that before anything.

RLarge (4)

@AndrewMarkarian Okay thanks! The whole thing is still a work in progress, so I must have forgotten that part.