Diagnosis first — which keys, when?
Open System Settings → Accessibility → Keyboard → Accessibility Keyboard. The on-screen keyboard highlights any key as you press it. Methodically test every key. Note which ones fail, which are stuck, which are duplicate-pressing.
Pattern matters: a single dead key is almost always a single-key issue (debris, a single failed switch). Multiple keys in a row failing usually means flex-cable damage from spill or heat. Whole keyboard dead = top-case replacement.
Butterfly keyboard era (2015–2019)
If your Mac has a butterfly keyboard (15-inch MacBook Pro 2016–2019, 13-inch Pro 2016–2019, 12-inch MacBook 2015–2017, MacBook Air 2018–2019), single-key failures are extremely common and Apple ran an extended service programme.
The fix is always a full top-case (keyboard, battery, trackpad as a unit) because Apple riveted these components together. Cost in Pakistan for a non-Apple-covered swap: PKR 35,000–55,000 fitted with a 90-day warranty.
Magic Keyboard era (2019 onwards)
Newer MacBooks use the scissor-switch Magic Keyboard which is much more reliable. Most failures are spill or debris damage. We can do single-key replacements on these, fitting a new individual key for PKR 2,500–5,000.
If the whole keyboard is dead after a spill, the flex cable beneath it has corroded — that needs a full top-case in the PKR 35,000–65,000 range, same warranty as butterfly swaps.
Software causes worth ruling out
Try a different user account (System Settings → Users → Add User → log in as the new user). If the keyboard works there, the issue is a software-side keyboard remap (Karabiner-Elements, Hammerspoon, etc.). Boot in Safe Mode (Shift on Intel, power-hold on Apple Silicon) to rule out third-party kexts.
