Comments (15)
I have a question, are the inputTexts supposed to work already now? Because in my projects, nothing happens when I press a key in an inputText even with active callbacks.
from imgui.
Yes, what are you using? Could you paste here a snippet of code?
from imgui.
Hi !
I am still using libGDX so the Lwjgl3 wrapper.
I initialize Lwjgl3 with :
LwjglGL3.init(GlfwWindow((Gdx.graphics as Lwjgl3Graphics).window.windowHandle), true)
I'm going to try to list all the problems I find using keyboard widgets. I use the test window (ImGui. showTestWindow) for the different tests I have performed (in widgets -> basic).
When i install callback, I can correctly enter a number on the keyboard on dragInt/dragFloat. But when I just click on an inputInt/inputFloat the program crash. With this error :
Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Scanner.java:864) at java.util.Scanner.next(Scanner.java:1485) at java.util.Scanner.nextFloat(Scanner.java:2345) at imgui.Static_funcsKt.dataTypeApplyOpFromText(static funcs.kt:599) at imgui.imgui.imgui_internal$DefaultImpls.inputScalarEx(internal.kt:2140) at imgui.ImGui.inputScalarEx(imgui.kt:27) at imgui.imgui.imgui_internal$DefaultImpls.inputScalarEx(internal.kt:2114) at imgui.ImGui.inputScalarEx(imgui.kt:27) at imgui.imgui.imgui_widgetsInputKeyboard$DefaultImpls.inputFloat(widgets inputKeyboard.kt:53) at imgui.ImGui.inputFloat(imgui.kt:27) at imgui.imgui.imgui_internal$DefaultImpls.inputFloatN(internal.kt:2075) at imgui.ImGui.inputFloatN(imgui.kt:27) at imgui.imgui.imgui_widgetsInputKeyboard$DefaultImpls.inputFloat3(widgets inputKeyboard.kt:69) at imgui.ImGui.inputFloat3(imgui.kt:27) at imgui.imgui.imgui_widgetsInputKeyboard$DefaultImpls.inputFloat3$default(widgets inputKeyboard.kt:68) at imgui.imgui.demo.widgets.invoke(widgets.kt:298) at imgui.imgui.demo.ExampleApp.invoke(ExampleApp.kt:238) at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showTestWindow(demo debug informations.kt:85) at imgui.ImGui.showTestWindow(imgui.kt:27) at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showTestWindow(demo debug informations.kt:81) at imgui.ImGui.showTestWindow(imgui.kt:27) ...
The next thing is the inputText. I can click on it and have a cursor displayed but nothing happens when I press a keyboard touch.
The last problem I encountered is I think it's related to the fact that I use libGDX with this library.
Indeed, when I install callbacks in the init function of Lwjgl3, it is impossible for me to use libGDX inputs. I cannot use functions such as Gdx.input.isKeyPressed
or the Scene2D. I think the problem is that the install callbacks function replaces all callbacks that libGDX already uses on the window. If necessary, I can try to create my own wrapper for libGDX using an InputMultiplexer for example.
I hope to have been quite clear despite my low level of English. Thanks to you, Catvert.
from imgui.
Any feedback? :)
from imgui.
Yes,
sorry for the delay but I'm trying to finish the fbx support for assimp asap
Anyway, the InputMismatchException
happened because of a locale mismatch, now the Scanner
(used to parse the input) will use the locale set in style.locale
, which on start will be the java default locale
inputText
is working for me.. can you test the demo under Widgets
-> Text
-> JVM UTF-16
-> try to type there
At the moment if you pass true
in LwjglGL3.init()
imgui will install its callbacks (overwriting what is there).. and the thing is, you can only have a single callback per type per time.
we are discussing here, to create support out-of-the-box for multiple callbacks of the same type. In the meanwhile, pass false
and call each imgui callback manually from your application callbacks
from imgui.
Hi !
First of all, thank you again for your work. That's excellent!
I don't have any more problems with the InputMismatchException !
I've created the callback adapter for inputs for libGDX, I'll post my results in the wiki (if you can take a look at it when I add it).
I have one last little problem, which has nothing to do with the previous problems. I noticed that you are using a CharArray (CharArray (size)) for the inputText buffer in UTF-16. How can I later translate this buffer to convert it into string?
Thanks to you, Catvert.
from imgui.
Yup, you are welcome :)
I'll try to remember to take a look, maybe you can "up" here to notify
String(CharArray)
, they offer a constructor accepting char array to build a string
from imgui.
Oh yes it's working, it was another error in my code.
I just finished writing it!
from imgui.
It looks perfect, thanks
from imgui.
Thanks to you too! :)
from imgui.
Hi !
I found an another issue. When I want to put a negative number in an inputInt, if there is no number in the field and I add a minus sign, the program crashes with an InputMismatchException from the Scanner.
from imgui.
stacktrace? code?
from imgui.
Hi ! This is the stacktrace, when I put a minus sign on an empty inputInt in the demo window :
Exception in thread "main" java.util.InputMismatchException
at java.util.Scanner.throwFor(Scanner.java:864)
at java.util.Scanner.next(Scanner.java:1485)
at java.util.Scanner.nextInt(Scanner.java:2117)
at java.util.Scanner.nextInt(Scanner.java:2076)
at imgui.Static_funcsKt.dataTypeApplyOpFromText(static funcs.kt:577)
at imgui.imgui.imgui_internal$DefaultImpls.inputScalarEx(internal.kt:2135)
at imgui.ImGui.inputScalarEx(imgui.kt:27)
at imgui.imgui.imgui_widgetsInputKeyboard$DefaultImpls.inputInt(widgets inputKeyboard.kt:92)
at imgui.ImGui.inputInt(imgui.kt:27)
at imgui.imgui.imgui_widgetsInputKeyboard$DefaultImpls.inputInt$default(widgets inputKeyboard.kt:88)
at imgui.imgui.demo.widgets.invoke(widgets.kt:312)
at imgui.imgui.demo.ExampleApp.invoke(ExampleApp.kt:234)
at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:86)
at imgui.ImGui.showDemoWindow(imgui.kt:27)
at imgui.imgui.imgui_demoDebugInformations$DefaultImpls.showDemoWindow(demo debug informations.kt:82)
at imgui.ImGui.showDemoWindow(imgui.kt:27)
from imgui.
#23 fixes
from imgui.
Nice work thanks !
from imgui.
Related Issues (20)
- Example Log doesn't display any text unless a filter is applied HOT 1
- is jdk8-snapshot doesnt work anymore? HOT 1
- Shaders do not compile on M1 (macOS 11.4) HOT 3
- Methods need unecessary parameters when used in java HOT 3
- Some clear, modern example would help
- Unable to load ForwardDeclarationsKt when using Java modules HOT 2
- Use of `static` in package identifier can cause Java interoperability problems HOT 1
- MainMenuBar causes NullPointerException when clicking on free space HOT 1
- `listbox` shows no items
- ImGui can't access static fields and members of org.lwjgl.stb.STBRPRect HOT 3
- Invalid Package name HOT 3
- Index 33619455 out of bounds for length 0 HOT 1
- Documentation still references dl.bintray.com (shutdown nearly two years ago) HOT 1
- Is there a version of imgui for kotlin that works with lwjgl 3.3.1 HOT 7
- Cant get VertexBuffer data from DrawList class HOT 27
- Update Wiki HOT 1
- java.lang.NoClassDefFoundError: uno/glfw/HWND HOT 4
- Rendering artifacts on non-square elements HOT 1
- useBufferSubData breaks rendering completely, if set to true
- NoClassDefFoundError: uno/glfw/HWND HOT 1
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 imgui.