22 Apr 2014

36561

0

Menus and keyboard navigation

Sorry for the delay.

This past week has been full of holidays and the inevitable family meetings, so the report will be short.

After spending some more time on the context menu bug, I decided to leave it aside, and focus on things that improve the progress. If the code is incompatible with TortoiseGit for some reason, I can figure that out later.

The next issue on the list was the keyboard navigation. Navigation across vertical menus used to work, but with all the changes to the focus manager and such, it stopped working. I fixed the flow of calls that resulted in the menu item changing, and reorganized the code a bit in the process. This put the vertical navigation in working conditions, but the horizontal navigation on the menu bar was still completely missing.

For the horizontal navigation, I needed to achieve 2 goals. The first, was to be able to handle moving left and right while a system-managed popup is open, and the second was to handle left and right while a shell menu is open.

For the former, I looked at some examples of custom menus, and noticed that they would handle the keys in a message filter, and I modified the already existing message filter of the focus manager to handle the keys in a similar way. I had to add some logic to decide if a submenu was open, and if the current item was supposed to open a submenu, so that I could decide if pressing left or right would cause the active menu to change.

For the shell menu, I already had some code in place, but it was obviously not working.  I tried to fix the logic, but I ran out of time, and I had to be elsewhere for the holidays.

As of writing, the menubar lets you switch the menus left and right, until you hit the Favorites menu. Once the favorites menu is shown, the left/right keys don’t behave as expected, and the only way to switch back to the other menus is with the mouse. Also, there are some cases when moving through the menu items will include the system menu in the rotation. I will have to verify when, and try to implement the logic for it.

And now, with a gray sky and the sound of rain outside, I have to fight the urge to go back to sleep, and get myself to do something useful. ;P

Discussion: https://www.reactos.org/forum/viewtopic.php?f=2&t=13257

This blog post represents the personal opinion of the author and is not representative of the position of the ReactOS Project.