usually caused by a faulty usb device or damage to one of the usb ports making the pins in the port touch each other
unplug all usb devices except mouse and keyboard if they are usb and see if it works ok
if it still doesnt work move the mouse and keyboard if they are usb to different usb ports
assuming this gets it working look closely in the other usb ports for bent pins--use a torch if needed
if all are ok plug in usb devices one at a time till it happens again--then double check the port that caused the fault--if the
port looks ok the usb device you plugged in may be faulty