osgQt Key Press Jumping the Earth Scene #2901
-
|
Hi all, I'm working on a Qt Application that houses osgEarth. I've integrated the osgQt repo (modified for Qt6.x) into the application so that my Qt app can properly translate and forward Qt KeyEvents to osgEarth. A remap example is as follows: Everything seems to be working great except for the arrow keys. A single press makes earth scene jump a large amount instead of a small, incremental amount. For example, with the earth scene zoomed out to the US.. a single "right" key press will jump the earth scene to Africa. An "up" key press will jump to the north pole. I'm of course expecting it to be a very small, minute distance. Holding the key repeats this behavior and makes the earth scene jump all over. To prevent that -- I've added a which has fixed the issue with holding the key. Still, however -- the very initial key press will jump the earth scene. This seems to a local and/or osgQt issue rather than an osgEarth issue -- but in case anyone here had some ideas or thoughts on this, it would be much appreciated! Thank you all |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
I found it. The cause for this issue was due to my initialization order in the osgQt constructor. It seems to have affected an internal timer which broke the methods below |
Beta Was this translation helpful? Give feedback.
I found it. The cause for this issue was due to my initialization order in the osgQt constructor. It seems to have affected an internal timer which broke the methods below
osgGA::GUIEventAdapter* keyRelease(int key, int unmodifiedKey = 0) { return keyRelease(key, getTime(), unmodifiedKey); }osgGA::GUIEventAdapter* keyPress(int key, double time, int unmodifiedKey = 0);