keyboard stuff

Tidy up duplication of MIN/MAX fallback implementations (#20236) master


+7 -32
8 changed files