Comments (4)
Thanks for reporting this. Looks like this is our bug, not AntTweakBar's.
Currently the igl::Viewer
is setting up glfw with a wrapper to call AntTweakbar's TwKeyPress immediately on "char events" and send all "key events" to AntTweakbar's TwEventKeyGLFW3 (which ignores non-special keys) and then down to the viewer plugins and callbacks. So when you press 't'
this fires twice: 1) as a "char event" to TwKeyPress in glfw_char_callback
and again 2) as a "key event".
During 1) AntTweakBar finds that we have attached 't'
to the "Fill"
button and toggles it appropriately. The function correctly returns true revealing that AntTweakBar handled the event, but nobody's listening.
During 2) AntTweakBar ignores 't'
since it is not a special key, thus returning false. igl::Viewer
thinks this means AntTweakBar has ignored 't'
entirely and sends the key down to the plugins and callbacks.
Problem: This will not be trivial to fix. All the plugins and callbacks are set up to implement both key_down
and key_up
events and not "char events". However, it doesn't seem possible to uncover the "char" from the key events. For example pressing 't' and 'T' (SHIFT + t) is the same "key" but not the same "char". It's not as simple as just checking for shift since this can be keyboard dependent. On my American keyboard SHIFT+'0'
is ')'
but on a Swiss keyboard it's '='
. I don't think we want to implement all keyboard maps...
Proposed solution: Change all plugins and callbacks to include a simple key_pressed
event which will fire for non-special keys with the correct casing. Instruct users that this is usually what's needed. Rename the current key_down
and key_up
events to something like raw_key_down
and raw_key_up
to discourage general use.
@danielepanozzo The proposed change will likely break many examples and apps. Let's agree when and how to do it and set up some conversion documentation like the last major change in the main library.
To make matters more confusing, it looks like igl::Viewer
is implementing its own globally defined TwEventKeyGLFW3
. I guess because AntTweakBar's TwEventKeyGLFW
uses old key enums? This is an unrelated problem, but I guess we should move this into our, already patched, copy of AntTweakBar in libigl/external/AntTweakBar/
. At the very least we ought to clean up all these global functions and global variables.
from libigl.
Note: This problem was not solved during the major update to libigl version1.2.
from libigl.
Looks like this very same issue is showing up in nanogui, too...
from libigl.
This issue has been resolved, see tutorial entry for biharmonic coordinates for proper use of key_pressed
(rather than probably-soon-to-be-deprecated key_down
). It remains an issue to update all other tutorial entries and to forward this issue to nanogui
from libigl.
Related Issues (20)
- Migrate away from std::is_pod (deprecated in C++20) HOT 1
- issue with flip edge function
- ray_mesh_intersect: corner-case fails on windows CI update HOT 1
- Assertion error in forward_kinematics Assertion `m == (int)dQ.size()' failed with eigen 3.4
- links to target "igl::opengl_glfw" but the target was not found HOT 4
- [MSVC] Unable to Download Resources from CGAL in Libigl due to Broken Link HOT 1
- Link error on Visual Studio 2022: can't open ilg::opengl_glfw_imgui.obj HOT 1
- New igl::split_nonmanifold routine failiing on some meshes "Assertion E(e1,1) == E(e2,0) failed."
- Index assertion error in ARAP HOT 1
- Reasons for the huge difference in performance between Mesh_boolean and CSGTree HOT 4
- GMP cannot build HOT 3
- fast_find_self_intersections false positives HOT 1
- Linker error on mac os continuous integration tests HOT 1
- Eigen slicing combined with solver calls lead to unexpected results
- Cisco Talos found security bugs in your code HOT 1
- IMGUI gflw mouse button presses not working
- vcpkg libigl won't compile seamlessly with the vcpkg imgui integration
- Getting this error while making with cmake
- libigl installs Eigen (lib/cmake/eigen/, include/Eigen/) also when LIBIGL_INSTALL == OFF HOT 5
- Is SVD broken in the header only install? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libigl.