If you're gonna go the hands-on route, IF IT IS a hardware issue, buying a replacement keypad flex is pretty cheap and is likely the problem rather than the hard plastic case (and even more likely that the flex connector is partially unseated, the XTS is famous for that).
I believe he said it was XTS5000, in which case I believe one of the button contacts (popple I think) to be bad/intermittent on the side of the radio. In which case he will have to replace the case. As the 5000 uses a connector from the flex to the buttons built into the side case.
If it was a XTS3000 he could replace the flex in the housing, as you suggested. (If I assume by keyboard flex, you mean housing flex.)
But it always a good idea when having issues to double check your flex connectors.
An easy test,,The Op could test the buttons by entering service mode and checking the button/s for an intermittent operation.
Just in case the OP is not sure how to enter service mode.,
You can enter the test mode by powering up the radio and then pushing the 2 dimpled side button 5 or more times quickly. (hopefully this is not your intermittent scan button)The radio will display service, hit the purple button until you see CH TEST then hit the top orange/emergency button to enter the button test mode.
The 3 side buttons are from purple button down should be 96, 97 and 98 with a /0 or /1 next to it.
/0=off and /1=on.
If you see for example 97/1 being displayed intermittently for longer than your programed long press time typically 1sec or longer, there's your problem.