Skip to content

Commit

Permalink
FancyMenu: fix Enter key not working
Browse files Browse the repository at this point in the history
- Add comment in event filter
  • Loading branch information
gfgit committed Feb 4, 2024
1 parent fd0ace4 commit 2589356
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion plugin-fancymenu/lxqtfancymenuwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,23 @@ bool LXQtFancyMenuWindow::eventFilter(QObject *watched, QEvent *e)
|| watched == mCategoryView->viewport()
|| watched == mAppView->viewport()))
{
/* Basically we take all keyboard events sent to:
*
* - Search QLineEdit
* - App QListView's viewport()
* - Category QListView's viewport()
*
* And we manually redirect them to the selected one.
* Then event gets eaten up so it doesn't get processed
* by it's original destination widget.
*
* If selected item is same as destination widget, no
* redirection happens, we call default event filter
* to let Qt manage it's internal state.
*/

QKeyEvent *ev = static_cast<QKeyEvent *>(e);
if(ev->key() == Qt::Key_Return)
if(ev->key() == Qt::Key_Return || ev->key() == Qt::Key_Enter)
{
activateCurrentApp();
return true;
Expand Down

0 comments on commit 2589356

Please sign in to comment.