Bug 433260

Summary: Tabbing to select power/session item and pressing Enter/Return opens the selected/hovered item in the main view instead of doing nothing
Product: [Plasma] plasmashell Reporter: vindicator <nroycea+kde>
Component: Application Launcher (Kickoff)Assignee: David Edmundson <kde>
Status: RESOLVED FIXED    
Severity: minor CC: kde.bugs, kinofhek, mikel5764, mvourlakos, nate, plasma-bugs, rishavchoudhary90
Priority: NOR    
Version: 5.21.0   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.23

Description vindicator 2021-02-19 16:45:47 UTC
SUMMARY
Using keyboard to get the system to restart via the menu doesn't work.

STEPS TO REPRODUCE
1. Press the "Windows" key on your keyboard
2. Tab forward/reverse to Restart button
3. Press Enter

OBSERVED RESULT
Settings window opens.


EXPECTED RESULT
System restarts.


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Arch Linux
(available in About System)
KDE Plasma Version: 5.21.0
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
I don't think it actually causes the Settings window to open, but rather whatever was previously highlighted.

In my case, if I were to perform the steps above using the forward tab, the "Systems Settings" is highlighted, even while I'm still tabbing through the other options which also visually show they are being tabbed to.

However if I reverse tab to get to "Restart", nothing happens. I also just noticed that "System Settings" was also still highlight in this case, so I don't know what's up with that.
Comment 1 Nate Graham 2021-02-22 23:56:24 UTC
Can confirm if you have the mouse over an application while "Return" is highlighted with the keyboard. The return key launches the app that the mouse is over rather than the highlighted power item.
Comment 2 Mikel Johnson 2021-02-23 09:17:35 UTC
probably hover stealing focus, which helps with accessibility (reading entries on mouse over), will need to confirm if the solution is alright with accessibility folks
Comment 3 Felipe Kinoshita 2021-03-05 18:27:43 UTC
*** Bug 434023 has been marked as a duplicate of this bug. ***
Comment 4 Robin Bankhead 2021-03-22 09:37:07 UTC
It's not hover. I launched kickoff using Win key with mouse pointer well away from the launcher area, hit the 6* TABs to focus Sleep option, hit ENTER, and it opened the highlighted item from the Favourites list (Firefox in my case).

*Offtopic, but the added number of keystrokes to reach the power options is rather a retrograde step IMO.
Comment 5 Nate Graham 2021-04-09 02:25:03 UTC
*** Bug 435494 has been marked as a duplicate of this bug. ***
Comment 6 Nate Graham 2021-08-07 15:22:00 UTC
With the current state of git master (i.e. what will become Plasma 5.23), the few quirks have been fixed, which leaves us with the standard behavior: to activate a UI element that you have tabbed to, you hit the spacebar, *not* the return key.

If there is still a bug here, it's that the return key should not activate the highlighted item in the main list area unless that main list area has focus. Using the keyboard to activate an item whose view does not have focus is unusual. Lowering priority.
Comment 7 Bug Janitor Service 2021-08-07 15:35:44 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/542
Comment 8 vindicator 2021-08-07 20:52:04 UTC
? I would think that tabbing through various areas would automatically give that area focus.
It is my contention that if an item is highlighted, it is selected, and as such, the activation SHOULD be the Enter key.
Comment 9 Nate Graham 2021-08-09 15:47:21 UTC
That's not our decision; in the Qt world, it's the spacebar that clicks the focused control, not the return/enter key. For that matter, it works this way in macOS too. It's just one of those things you need to get used to.
Comment 10 vindicator 2021-08-09 19:09:55 UTC
Woooowww! I'm mind-blown. I'm no meager/newb user either and never knew that.
I just looked into it a TINY bit and came across:
https://stackoverflow.com/a/16090932

I'm trying to think of what I can do (besides... OH! okay, I just tried this on this issue and it still didn't work.)
1. Press the Window key
2. Press the space bar key

What happened: The space bar action was injected in the filter.
What should have happened: The space bar action should have "clicked" (mouse press down and up) the selected item which would be the first favorite item.
You could also press the right-arrow after step 1 to make sure the next favorite item is highlighted.

The enter key, instead of doing nothing, would change the "highlighted" look to a "selected" look for the highlighted item.

Once every item desired is selected, then the spacebar "clicks" all selected items (unless the last highlighted item is not selected, in which case, only that highlighted item is "clicked").

If you want to type (spacebar) in the filter, you'd need to tab/arrow to it first.

I'd love to find some program/window or site (probably not "site" since that would be dependent on the browser complying with the system rules) that would definitively show the effects of these actions.

As low-priority, it may be helpful in the keyboard settings to have a section where these things could be learned/tried-out.
The mouse section could have an image of a mouse where the button actions are highlighted in the image when pressed/released. Not sure how that would pan out with the various types of mice buttons and their locations.
Of course, it may just be easier to have a "help" link in those sections that explains these very basic (even though I didn't even know it) functions.
Comment 11 Nate Graham 2021-08-09 19:14:32 UTC
In a nutshell, these are the rules of thumb to determine which key does what:

1. The enter key will activate the currently selected item in lists, grids, etc, and it will virtually click the "default button" of dialogs
2. The spacebar key will virtually click the highlighted UI element that you have used the tab key to navigate to
Comment 12 Nate Graham 2021-08-11 14:33:07 UTC
Git commit 07c4e770491c53030919d589367e4ecc8f880ecb by Nate Graham.
Committed on 11/08/2021 at 14:32.
Pushed by ngraham into branch 'master'.

[appets/kickoff] Eat unfocused activations for non-search views

Unless we are showing search results, if the return or enter key is
pressed, we should not activate the selected item unless the item is
currently focused. Otherwise people can get confused by unfocused yet
previously selected items being activated when the return or enter key
is pressed.
FIXED-IN: 5.23

M  +7    -0    applets/kickoff/package/contents/ui/KickoffItemDelegate.qml
M  +1    -0    applets/kickoff/package/contents/ui/KickoffListView.qml

https://invent.kde.org/plasma/plasma-desktop/commit/07c4e770491c53030919d589367e4ecc8f880ecb