-
-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Key Interaction management in libf3d is not great and should be improved #443
Comments
related to #438 |
I agree it should be improved, and customizable. |
how about an API like this:
What I'm not sure about is how do we convert the intention of the user : I'm not even sure about the
but VTK do not provide the right keysym or keycode:
If we want to provide better interaction, I think we definitely needs to improve VTK to give us the correct key code. We should not have to handle keyboard layouts in the libf3d. |
The current API is I think it makes sense. We can save a map in libf3d (initialized on the application side?) so the user can provide his own bindings. |
If the keyboard mappings are expected to be configurable at some point it may be wise (convenient at least) to bind on strings so they can be loaded from a config file. Is there a spec of what to expect out of VTK's keyboard events? I slapped the following code in if (rwi->GetControlKey()) std::cout << " `ctrl`";
if (rwi->GetAltKey()) std::cout << " `alt`";
if (rwi->GetShiftKey()) std::cout << " `shift`";
std::cout<< " `" << rwi->GetKeyCode() << "`";
std::cout<< " -> `" << rwi->GetKeySym() << "`" <<std::endl; ...and, running Fedora (Gnome, X11), with a Qwerty layout I get:
switching the OS to Azerty layout:
So it looks like VTK is somehow layout-aware even though the output seems a bit confused to me. But you guys don't seem to have the same experience on your end. Does VTK delegate stuff to the OS? Do we need a minimal executable to only print keyboard events and test on different systems? |
I suspect maybe my Window Manager is playing some tricks on me. I will check.
I will check the code on VTK side
Lets hope we dont. |
@snoyer running your test I do not see the same behavior on ArchLinux + AwesomeVM:
switching the OS to Azerty layout:
In short, in my case, VTK is not aware of the layout at all apart from the I will try other OSes and DE. |
A quick test is to press the Shift + |
Tested on Ubuntu 22, MacOS and Windows, they all behave like yours @snoyer . |
Note: VTK has been fixed, see here for more info: https://discourse.vtk.org/t/about-keycode-keysym-modifiers-crossplatform-and-reliable-code/12598 |
WIll need a libf3d options rework |
Describe the bug
Currently the management of interactions is fully handled inside of the libf3d, without the possibility of customization.
Moreover, somekey are not accessible as the key input from VTK is "raw", making some key unreachable by just using the keyboard on some keyboard layout.
To Reproduce
Steps to reproduce the behavior:
f3d --dry-run example.glb
Expected behavior
Camera information appears.
Additional context
This may require some changes in VTK, unless we want to take care of converting raw input from VTK and converting them to actual user input.
Moreover, if we tackled customization, we need to make sure the cheatsheet stay synchronized.
Wdyt @jpouderoux @Meakk ?
The text was updated successfully, but these errors were encountered: