Chosen Solution

The keyboard stopped working due to use and I replaced it with a new one. Then the keyboard and trackpad stopped working. But it works with external keyboard and mouse. Then I installed the operating system Windows 8 and Windows 10. On the Macbook and there the keyboard and trackpad works normally. Additional information -> Before changing the keyboard, the battery lasted 10 minutes. Update (11/24/2022)

Update (11/28/2022) I was thinking of just buying a new battery but any idea why my keyboard and trackpad are not working? When I turn on the MacBook and press “Command (⌘)+ R” to boot from the macOS built-in recovery system, the keyboard does work

You’ve got a bit of an onion problem! Let’s see if we can unwind some of the layers so we can discover what’s needed. MS Windows accesses the internal USB ports differently than the external USB ports. Basically, Apple uses an internal USB hub for both the keyboard and trackpad independent from the external ports. So while you replaced the keyboard there might be an additional issue here as Apple’s Internal keyboard and trackpad uses the SPI interface into the PCH chip. As the external USB ports use a different USB hub and connect directly to the PCH chip it can confuse things. Either you got the wrong keyboard from what your system is expecting or there is a circuitry issue within the logic board. It also sounds like you have a battery issue as well as 10 minutes is not very long when I can get easily a two to three hours on my system. Let’s get back to macOS and then install this app CoconutBattery take a snapshot of the apps main window and paste it here for us to see. Using the external keyboard and mouse open up About This Mac and open up System Report, now slide down to USB section you should see under USB 2.0 Bus Hub and the Keyboard/Trackpad entry. Click on it and tack a snapshot of the lower panels info and post it here for us to see as well.

If your keyboard or trackpad issues have just started, it’s possible that a recent change in software or settings has caused the problem. To fix it, just roll back your Mac a few saved backups: Restart your Mac. While the system is rebooting, open the Recovery Tool by pressing Command + R. Regards, Will

It’s fine. I have a question, the MacBook came with an English keyboard, but since it got damaged, I bought a Spanish keyboard, does it have something to do with the keyboard and trackpad not working?