The 'input menu' would put a small flag on the main menu bar and allow
you to click there, and see Keyboard Viewer, and Character Palette. A
small keyboard will appear on the desktop and mirror all keys you use
on the real keyboard. Or not. When they don't work in the Viewer, you
can safely assume they don't work. (Or it is software, vs hardware.)
Someday, when you have time and perhaps some extra hardware, you
may consider making a backup clone of your computer contents on a
large enough external hard disk drive to support bootable OS X clones;
and also large enough to have more than one partition there, for extras.
Then, do a completely new installation on a 'secure erased' hard disk drive.
And then update it. You could migrate previous user setting info, into the
new installation from an external drive's clone; or if you have extra discover
time, you may find a cure to the underlying problem's cause and use the
clone in the external hard disk drive as a backup. Maybe DiskWarrior?
The problem in the system may be due to at least one possible malady; a
corruption of system data, a bad block on the hard disk drive, or some other
matter that somehow became bigger than life when combined with another.
You may try the SafeBoot mode, repair disk permisions in Disk Utility, and
then try reinstalling the Mac OS X 10.5.8 Combo update file, on top of it all.
Then when it restarts, run SafeBoot again and re-repair disk permissions.
(But any actual hard disk drive issue may exist and remain unattended.)
Odd problems often are best attacked at a root level, after you have adequate
backup; a bootable clone on supported self-powered external hard disk drive.
Clone utilities such as SuperDuper and Carbon Copy Cloner are fine tools;
and CCC (bombich software) has evolved to be top-notch with site support.
Glad you were able to remap some keys; I found several links in a search on
how to do that, and had previously posted some URLs to help someone else
on another user forum that covered some angles of resolving keyboard issues.
Good luck & happy computing! 🙂