This adds a keyboard layout switch callback and a query for the human-readable name of the current layout. Fixes #1201.