The proposed preliminary settlement was filed late Monday night in the federal court in San Jose, California, and requires a judge's approval.
Customers claimed that MacBook, MacBook Air and MacBook Pro keyboards suffered from sticky and unresponsive keys, and that tiny amounts of dust or debris could make it difficult to type.
They also said Apple's service program was inadequate because the Cupertino, California-based company often provided replacement keyboards with the same problems.
The settlement covers customers who bought MacBook, MacBook Air and most MacBook Pro models between 2015 and 2019 in seven US states: California, Florida, Illinois, Michigan, New Jersey, New York and Washington.
Apple denied wrongdoing in agreeing to settle. It did not immediately respond on Tuesday to requests for comment.
Lawyers for the customers expect maximum payouts of $395 to people who replaced multiple keyboards, $125 to people who replaced one keyboard, and $50 to people who replaced key caps.
Customers also remain eligible for four years of free keyboard repairs following their purchases.
The customers' law firms, Girard Sharp LLP and Chimicles Schwartz Kriner & Donaldson-Smith LLP, may seek up to $15 million for legal fees, which would be deducted from the $50 million settlement fund, court papers show.
The case is In re: MacBook Keyboard Litigation, US District Court, Northern District of California, No 18-02813