fixes to keymapping and element id lookups. exception handling for invalid keypresses. fixed switch for event triggering