Fixes the wrong match between key symbols and keys on non-QWERTY keyboards

It uses the correct method to map key symbols (layout dependent) and keys. Moreover, it is a nice workaround for the bug 723 and I have removed useless methods taking integer codes in input.