I've built a few keyboards and they have used M2 or M3 screws.
I've mostly seen M2 screws on boards where the PCB just drops into the case and you screw it to the standoffs on the bottom. The bottom of the case supports the PCB, so large screws aren't needed, they are just there to hold it in place.
I have a couple of boards where the the plate is screwed into the underside of the case, and the pcb is actually suspended from the plate and doesn't touch the bottom of the case at all. These cases have a clear/frosted acrylic bottom, so that the underglow shines through. These cases have used the bigger M3 screws, since the plate is being supported by the screws themselves, and does not rest on the bottom of the case.