funny enough, I just asked the same question yesterday night after trying a ton of things (nobody was able to answer mine so far). Apparently, both OptionMenus and MenuButtons only admit the keyboard input (and predefinted functions) of arrow keys, return and escape, when posted (when the cascade is displayed).
But today I came up with a solution (for my particular case) that might also interest you, and that's changing the options before displaying the cascade.
Here's my question and my own answer from today: is there a way to change the keys to navigate the tkinter MenuButton options in python?
In your case, I would bind to the "a" key the hiding of all the options inside the OptionMenu that you want BEFORE displaying the menu (the menu would have to be at least focused to do so, or referenced in any way).
You can use my code to identify the index of the options that start with "a" (if they are contained in a list or a dictionary), and use these functions to hide or unhide the radiobuttons (or other widgets) with that label:
def hide_radiobuttons():
for rb in radiobuttons:
rb.config(state="disabled")
def show_radiobuttons():
for rb in radiobuttons:
rb.config(state="normal")
This might not be suitable for your particular case, but it's an option.
Also, I'm not an experienced coder, so there might be mistakes in my solution (even thought it worked for me).
Hope this helps.
Cheers.