Skip to content

Commit 8dbc0a7

Browse files
committed
WIP: fix keyboard shortcuts with alternative layouts
1 parent 350234b commit 8dbc0a7

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

YACReader/main_window_viewer.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,11 @@ void MainWindowViewer::disableActions()
10391039

10401040
void MainWindowViewer::keyPressEvent(QKeyEvent *event)
10411041
{
1042+
if (1) {
1043+
QMainWindow::keyPressEvent(event);
1044+
return;
1045+
}
1046+
10421047
//TODO remove unused keys
10431048
int _key = event->key();
10441049
Qt::KeyboardModifiers modifiers = event->modifiers();
@@ -1243,7 +1248,7 @@ void MainWindowViewer::processReset()
12431248
void MainWindowViewer::setUpShortcutsManagement()
12441249
{
12451250
//actions holder
1246-
auto orphanActions = new QObject;
1251+
auto orphanActions = this;
12471252

12481253
QList<QAction *> allActions;
12491254
QList<QAction *> tmpList;
@@ -1262,6 +1267,8 @@ void MainWindowViewer::setUpShortcutsManagement()
12621267
QAction *toggleFullScreenAction = new QAction(tr("Toggle fullscreen mode"), orphanActions);
12631268
toggleFullScreenAction->setData(TOGGLE_FULL_SCREEN_ACTION_Y);
12641269
toggleFullScreenAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(TOGGLE_FULL_SCREEN_ACTION_Y));
1270+
addAction(toggleFullScreenAction);
1271+
connect(toggleFullScreenAction, &QAction::triggered, this, &MainWindowViewer::toggleFullScreen);
12651272

12661273
QAction *toggleToolbarsAction = new QAction(tr("Hide/show toolbar"), orphanActions);
12671274
toggleToolbarsAction->setData(TOGGLE_TOOL_BARS_ACTION_Y);

0 commit comments

Comments
 (0)