Keyboard buttons handling implementation