All of this code re KEYBOARD_EXCEED doesn't seem to do anything except print out on the console.  Is this debugging code left over from an obsolete design fork?  I am going to remove it for now, unless you say differently.