I can't recall if I've seen this done differently, but I'm slightly nervous that this might change between versions since it's (I think?) a private API class. Can you think of any other way that we could match the keyboard that might be a bit less brittle? If not, we can probably go with this in the short term and I'll add another issue for finding a better way.