fixe some bug and add keyboard compare

fixe some bug and
i ve add glue poly
i ve add keyboard compare to simplify the code in a loop "if"