Giter Site home page Giter Site logo

Comments (4)

nsf avatar nsf commented on July 30, 2024

Hm, it probably happens if both stdin and sigwinch were signalled.

https://github.com/nsf/termbox/blob/master/src/termbox.c#L666-L685

Here I just return if one of them is ready, but I don't handle a case when both are ready. I'll think about a way to fix it. But if you can fix it yourself that'd be much nicer.

from termbox.

osa1 avatar osa1 commented on July 30, 2024

The code you pointed gave me ideas and I fixed this. Basically when select() fails, I'm calling tb_peek_event() with timeout 0. When select() fails because of a resize signal, termbox is returning a resize event. Awesome!

Thanks for the help.

from termbox.

osa1 avatar osa1 commented on July 30, 2024

It's still a bit sad that some events can get lost if termbox's event handlers are not called immediately...

from termbox.

nsf avatar nsf commented on July 30, 2024

Yes, ideally we need some sort of raw integration into event APIs like select.

My recomendation is to use Go version of the termbox instead and Go itself as well. If that's possible. It has a proper model for dealing with events and writing event-driven stuff there is super easy.

from termbox.

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.