A keyboard fixing structure comprising a housing case, at least one first magnetic component, a keyboard and at least one second magnetic component, the at least one first magnetic component fixed on the housing case, the at least one second magnetic component fixed on the keyboard and corresponding to the first magnetic component, the at least one second magnetic component adsorbed with the first magnetic component by magnetic force, wherein the housing case has a carrying groove for carrying the keyboard, and the keyboard fixing structure is characterized by: the carrying groove further having dimples inside, with the first magnetic components being respectively embedded in the dimples, wherein the number of the dimples correspond to the number of the first magnetic components, wherein the keyboard further has an input surface and a bottom surface opposite to each other, and the input surface has keycaps, and wherein the second magnetic components are fixed on the bottom surface, and are corresponding to the first magnetic components, wherein, when the second magnetic components and the first magnetic components are adsorbed with each other, so that the keyboard is fixed in the carrying groove of the housing case through a magnetic adsorption force between the second magnetic components and the first magnetic components,, the second magnetic components are also snapped in the dimples, so that the keyboard has a constraint in a plane direction, so as to strengthen an effect of fixing the keyboard on the housing case, wherein the first magnetic component comprises a first magnetic surface and a first non-magnetic surface opposite to each other, the second magnetic component comprises a second magnetic surface and a second non-magnetic surface opposite to each other, the first magnetic component is attached to the housing case with the first non-magnetic surface, and the second magnetic component is attached to the input device with the second non-magnetic surface, wherein the carrying groove is provided with a rectangular bottom plate in which the dimples are provided, wherein the carrying groove is completely surrounded by the housing case in a plane perpendicular to the depth direction of the carrying groove; wherein the dimples are completely surrounded by the bottom plate of the carrying groove in a plane perpendicular to the depth direction of the carrying groove. the carrying groove further having dimples inside, with the first magnetic components being respectively embedded in the dimples, wherein the number of the dimples correspond to the number of the first magnetic components, wherein the keyboard further has an input surface and a bottom surface opposite to each other, and the input surface has keycaps, and wherein the second magnetic components are fixed on the bottom surface, and are corresponding to the first magnetic components, wherein, when the second magnetic components and the first magnetic components are adsorbed with each other, so that the keyboard is fixed in the carrying groove of the housing case through a magnetic adsorption force between the second magnetic components and the first magnetic components,, the second magnetic components are also snapped in the dimples, so that the keyboard has a constraint in a plane direction, so as to strengthen an effect of fixing the keyboard on the housing case, wherein the first magnetic component comprises a first magnetic surface and a first non-magnetic surface opposite to each other, the second magnetic component comprises a second magnetic surface and a second non-magnetic surface opposite to each other, the first magnetic component is attached to the housing case with the first non-magnetic surface, and the second magnetic component is attached to the input device with the second non-magnetic surface, wherein the carrying groove is provided with a rectangular bottom plate in which the dimples are provided, wherein the carrying groove is completely surrounded by the housing case in a plane perpendicular to the depth direction of the carrying groove; wherein the dimples are completely surrounded by the bottom plate of the carrying groove in a plane perpendicular to the depth direction of the carrying groove.