Use the X state instead of the VK key state to check for eatable characters, since the VK key state isn't a fan of AltGr.