In our quickstart module, we have two examples of tracking keyboard events via focus and blur as well as another example of using operator modifiers keys. To get started:
Launch the server by double-clicking start_server.bat found in the directory HOOPS_Communicator_2024.X.x\quick_start
Click the following URLs to view the aforementioned examples:
There are modifier keys for mouse input, but not for keyboard inputs. Also, those examples don’t really provide the solution that I am looking for.
I want to be able to tell if I press Ctrl + Z in my operator through my onKeyDown events. onMouseDown has getModifiers() function which is exactly what I need but for onKeyDown…
We tried something like this, but this doesn’t work as soon as the focus on the hoops viewer is gone. Let’s say you do an “alt+tab”. onKeyDown will record alt as being pressed down, but now you are no longer in the viewer, and you let go of the alt key. When you come back to the viewer, the alt key is still flagged as true, even though you are not holding it down.
This method is not reliable. Our next solution was to make a separate service which could track the keys being pressed down.
I was just hoping that there was already a solution from Hoops on the matter