GithubHelp home page GithubHelp logo

Comments (4)

Nielsbishere avatar Nielsbishere commented on July 20, 2024

This is probably related to #14, as before the PR when a mouse button was clicked, it wasn't consumed. I'm assuming the same is the case with keyboard input (I've not done anything related to editable text yet, so can't confirm this statement yet). The key is "down" in the nk_context even though it is already consumed by the text input, but will remain in that state until the key up event is called. This could potentially be solved the same way as mouse input; by adding a bool per key that is reset when the key is released and set when the key is consumed.

from nuklear.

00BUG00 avatar 00BUG00 commented on July 20, 2024

Has this problem not been solved yet?
I have the same problem
windows + glfw3 + GL3

from nuklear.

telephone001 avatar telephone001 commented on July 20, 2024

I think glfw might be the problem here. Nuklear uses glfw char callbacks for normal characters. Special characters like backspace and up key are not reported in the glfw char callback. So Nuklear uses glfwGetKey for all special characters, which is called every time nk_glfw3_new_frame() is called. And when special characters are held down, nk_edit_string() modifies the string in the textbox everytime that it is called.

Solutions:
1. #define NK_KEYSTATE_BASED_INPUT in your project
this makes it so whenever you press down on a special key, the key is only reported once. But this means you
cannot hold down backspace to delete a bunch of text.
2. make nuklear use key callback for all characters?
idk. I don't know much about nuklear and glfw. But I wanna try and help

from nuklear.

dumblob avatar dumblob commented on July 20, 2024

@telephone001 thanks! We maintainers & devs are fully booked in our lifes so any help is highly appreciated.

from nuklear.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.