Well, my computer is working again. Sleep on the problem, and work out how to fix it.
Since the keyboard was working on the login screen and on the Live CD, I figured that it had to be something to do with my setup. So, I used the failsafe terminal, which just gives you a command line, to create a new user, and then logged in as that user to see whether the keyboard worked then. It did. So I compared the configuration files in the home directories for the new user and my current user. (Fortunately, I was able to switch user in a terminal in the new user without breaking the keyboard for my normal account, which meant I could easily edit my files. From the command line.) The keyboard directory in .gconf was not present in the new user. That means two things. First, it’s not necessary, and second, it could be the problem. So, I moved it up to my home directory, because if it’s in the wrong place it won’t do anything, and I might want to check the contents later. Then I logged out of the test user and logged in again as myself.
And the keyboard works. Even Japanese input works. è¦‹ã¦ã”è¦§ã€‚Although that Japanese full stop looks a little odd.