Fixed bug in event keydown capture that crashed when key ids greater than 256 were passed to chr()