vsg-qt Shortcut key exception #1341
idealist-dg
started this conversation in
General
Replies: 1 comment 2 replies
-
Your suggest fix does look appropriate. Could you create a PR on the vsgQt project with this fix so I can test/merge it. Thanks. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Robert,
I am using vsg-qt and I want to detect window keystroke events. For this purpose I used vsg::Visitor and overwrote void apply(vsg::KeyPressEvent& e), but I found that it did not work properly.
KeyEvent contains the following key fields.
KeySymbol keyBase = {}; KeySymbol keyModified = {}; KeyModifier keyModifier = {};
I don't know the purpose of keyModified, but I want to check for r in keyBase and ctrl and alt in keyModifier after pressing ctrl alt r. That's what I did, but I found that when I pressed ctrl alt, keyModifier was 0.
In order to track down cause I have found the VSG - qt - KeyboardMap. CPP, reading KeyboardMap: : getKeySymbol function. I notice that you take the information from QKeyEvent and update vsg::KeySymbol& keySymbol, vsg::KeySymbol& modifiedKeySymbol, vsg::KeyModifier& keyModifier.
The update process is as follows.
The modifier keys of QKeyEvent are mixed using the | operator, so after pressing ctrl alt, e->modifiers() is Qt::ControlModifier | Qt::AltModifier. The above code will not hit ctrl or alt. Instead, enter Qt::NoModifier.
I think the following is true, don't you think?
If this is correct, I hope to see it in future updates to vsg-qt.
Beta Was this translation helpful? Give feedback.
All reactions