There is provided a handheld surgical instrument comprising: a distal end for performing a surgical function; a body portion connected to the distal end and forming a housing; a processor contained within the housing; user controls formed on the housing and connected to the processor. The processor and user controls control the surgical function of the handheld surgical instrument and control a function of at least one other device associated with a surgery being performed. A surgical tray is also provided.