Keyboards might be suitable for reuse through a local reuse network such as Freecycle or Freegle. There are now a large number of reuse groups on Facebook. Or it could be repaired at your nearest Repair Café where volunteers will try and fix it for a small donation.
Otherwise these can be taken to a local Household Recycling Centre and included in the small electrical appliances container. For sites without a small electrical appliance container these can be included in the scrap metal container.