Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+17 votes

I created my project on a school computer and the arrow keys move my design within the game when its ran, but when I transferred it to my laptop (a Mac), without changing the code the arrow keys no longer move my design. Is there something different that needs to be done on a Mac vs school computer for it to work?

asked in CSC211_Winter2018 by (1 point)

1 Answer

+7 votes

The issue is with the output of the arrow keys on the Mac. I had this same issue. If you do a system.out.println statement to see what it is reading from the keyboard, on macs, the output is literally an arrow sign and not a string. Therefor when you want it to change the position of your design, the code will not find the string “left”, “up” etc...

answered by (1 point)
+1

If you want to use the arrow keys on a Mac, copy and paste these symbols as the string:




...