Yes, the new MacBook Pro keyboard membrane is meant to keep dust out
Apple's 2018 MacBook Pros feature a new membrane under the keyboard, and now we have confirmation on just what the film is intended to do.
The official answer is what many suspected all along: it's to prevent dust and other debris from getting under your keys and messing with the butterfly mechanism.
An excerpt from the 2018 MacBook Pro Service Readiness Guide issued to Canadian and European partners states:
Keyboard and Keycaps
The keyboard has a membrane under the keycaps to prevent debris from entering the butterfly mechanism.
On the US side, following a link to a document within the guide reveals a passage that reads:
Caution: The keyboard has a membrane under the keycaps to prevent debris from entering the butterfly mechanism. Be careful not to tear the membrane. A torn membrane will result in a top case replacement.
iFixit conducted a teardown of the 2018 MacBook Pros just a few days ago, uncovering the thin, silicone membrane that surrounds each key in the process. The site theorized it was to prevent dust and other detritus like sandwich crumbs from infiltrating the keyboard.
All Apple said at the time was that the third-generation keyboards were designed to be quieter. Now, though, we know that the membrane also acts as barrier to help keys last longer and register presses.
Apple has promised to replace 2015 – 2017 MacBook and MacBook Pro keyboards for free if users are experiencing issues with them, even if they don't have AppleCare. The replacement program will run for the next four years.