Changed config to dict and made it possible to specify key codes instead of characters