I think the real problem is I was on Windows but I had accidentally left my keyboard on a Mac setting, so the key codes were different. Or something. I'm trying it on a Mac in Safari now and it works, but now there's no sound. The joys of making web games...