mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
Reader: make 3 keyboard shortcuts work with non-Latin layouts
MainWindowViewer::keyPressEvent()'s custom matching of these shortcuts does not leverage all the features of standard Qt shortcut matching. As a result, the corresponding actions cannot be triggered when their assigned shortcuts consist of a single Latin letter without modifiers and e.g. Ukrainian keyboard layout is active. Furthermore, some key presses (e.g. Scroll Lock in my customized keyboard layout) set QKeyEvent::key() to 0, which the custom matching considers equal to an unassigned shortcut. So an action without shortcut is triggered by such a key press. Adding these 3 actions to MainWindowViewer and connecting the corresponding slots to their triggered() signals allows to remove the custom matching code and thus eliminates both of its issues.
This commit is contained in:
@ -4,7 +4,6 @@
|
||||
#include <QScrollArea>
|
||||
#include <QToolBar>
|
||||
#include <QAction>
|
||||
#include <QKeyEvent>
|
||||
#include <QMouseEvent>
|
||||
#include <QCloseEvent>
|
||||
#include <QSettings>
|
||||
@ -165,7 +164,6 @@ private:
|
||||
void getSiblingComics(QString path, QString currentComic);
|
||||
|
||||
//! Manejadores de evento:
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
// void resizeEvent(QResizeEvent * event);
|
||||
void mouseDoubleClickEvent(QMouseEvent *event) override;
|
||||
void dropEvent(QDropEvent *event) override;
|
||||
|
Reference in New Issue
Block a user