Fixed bug #116 - certain characters not working with de keyboard layout.

In XKB (X KeyBoard extension) environments the mapping returned by XGetKeyboardMapping may use different indexes for Mod5 and Mod5+Shift (see http://permalink.gmane.org/gmane.comp.xfree86.devel/3588).
=> I have modified the code to determine the index used in the local environment for AltGr mappings, so that characters such as `@` or `~` are correctly transmitted.

Testing:
- The code has been tested on a Linux/Ubuntu 13.10 machine with English, German
and Swiss keyboard mappings. Even passwords such as `#Ω€ŁŦŧ ¡²Zähler~@A12` have been correctly send to the corresponding applications.