Yes, the new MacBook Pro keyboard membrane is meant to keep dust out
https://www.techradar.com/news/yes-the-new-macbook-pro-keyboard-membrane-is-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.