A keyboard includes a keyboard processor configured for outputting a control signal for turning a computer on/off; a switch circuit connected to a turn-on port of a south bridge chipset on a mainboard of the computer; and a processor connected to the keyboard processor and the switch circuit. When the processor receives the control signal output from the keyboard processor, the processor outputs a high pulse signal to the switch circuit to make the turn-on port grounded to turn on or turn off the computer.