Those tables of Javacode keys code will work only for standard US keyboards, not for non English keyboard and probably not for Apple keyboards. Some keys will work and some not.
In fact Torchlight seems use Windows key codes and not Javascript key codes, the link provided in OP on a page giving Javascript code is right and wrong. The table is probably right for a standard US keyboard, not for other keyboards. But the input field where you type a key and then get the code seems not giving right Javascript code for non US keyboards but seems giving Windows code instead... and luckily Torchlight seems use those Windows key codes in settings.txt. So this input field is probably right for any keyboard even Apple and even non English.
With my Apple non english keyboard it is working fine, all mapping works by using the values given by the input field.
If you want a safer value this little application (no installation) is giving the right Windows codes, seems the same than used in settings.txt, it should work with any keyboard and seems more seriously programed than the bit of Javascript code in the link provided:
http://delphiforfun.org/programs/Utilities/KeyCodes.htm