That's a Java focus thing (either I added KeyMapper to the frame or to the Canvas and it's supposed to be the other one). Very likely it's a Java events bug, but as long as you don't mess with the frame (just start the program and don't ALT-TAB or anything) it should always work.
For my program, I have solved the position issue by adding a child object and getting its center, but it would be nice to figure out what this issue is (and potentially solve it).