Hello Konstantin,
Welcome to Microsoft Community.
As far as we know, I'm afraid that you can't do this at the moment, because when you physically connect the Flex keyboard to the Surface Pro 11, the corresponding port will be connected, which will automatically charge the Surface Pro Flex.
In other words, if the Flex keyboard doesn't charge itself when connected to the Surface Pro 11, this could lead other users to think that this is a problem that needs to be fixed.
But I have to say that the idea of adding a switch to the Surface App is probably a good one, except that I think you should give feedback directly to the Surface developers instead of posting a thread here, since the Surface development team is not in the community.
The most direct way to give them feedback is through the Feedback Center:
Send feedback to Microsoft with the Feedback Hub app - Microsoft Support
Once you've written your feedback, you can share the corresponding link here so we can vote for you. More votes will help the Surface support team notice the need more quickly.
Best Regards,
Mitchell | Microsoft Community Support Specialist