I’m working on adding accessibility support to desktop icons, but I have a problem: we are currently using our own code to move selections between icons using the arrows, so I need a way of telling Atk “this is the currently selected icon”. I tried using “grab_focus” on the specified icon, and it… kinda worked: Orca tells the next icon (this is: if I press the left arrow, the icon to the left of the current one is highlighted, but Orca says the one two places to the left of the original one; if I press the down arrow, Orca says the one two places down of the original one, and so on). It seems that the “grab_focus” call is done before Atk manages the arrow keys, so after I focus a widget, Atk manages the keyboard too and selects the “next” icon based on the now-focused widget. If I add a little delay (100ms) before calling “grab_focus”, everything works as expected. I’m already calling false in the key callback, but doesn’t seem to work.
I now that I could just connect to the “state-changed” signal and use that to highlight the currently focused icon, but the problem is that I need to be able to unselect all the icons, and that approach doesn’t allow to do that.