A self-adaption method for a keyboard, executed by a processor, wherein the keyboard comprises a scanning circuit, the scanning circuit comprises a plurality of scanning lines, a plurality of return lines, and a plurality of switching elements, and the switching elements are respectively coupled to intersections of the scanning lines and the return lines;
- the self-adaption method for keyboard comprises:
- setting a parameter set, wherein the parameter set comprises a plurality of response time parameters of the scanning lines;
- selecting at least one of the scanning lines as a testing line in a scanning round;
- feeding a scanning signal to each of the scanning lines in turn by the processor in the scanning round;
- in response to a conduction state of one of the switching elements coupled to the testing line, detecting a return signal on the corresponding return line by the processor;
- in a first duration in which the testing line maintains the scanning signal, detecting a starting point of the first duration to a starting point of the return signal corresponding to the first duration to obtain a time difference;
- and
- according to the time difference and the response time parameter corresponding to the testing line that is stored in a memory, determining whether or not to update the response time parameter corresponding to the testing line that is stored in the memory.