Comments (4)
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.
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.
It's still a bit sad that some events can get lost if termbox's event handlers are not called immediately...
from termbox.
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)
- Feature request: enable and generate focus gained/lost events
- Termbox does not start in LXC HOT 2
- Delayed ESC event in INPUT_ESC mode HOT 4
- Build failure on OpenBSD: SIGWINCH HOT 1
- Port https://github.com/nsf/termbox-go/issues/185 HOT 3
- demo doesnt work on Beaglebone
- Python.h: No such file or directory HOT 4
- TB_OUTPUT_256: Cannot use black / write CSI 38;5;0
- Improper select() error handling HOT 3
- Does not work with Python 3.7 HOT 4
- Confution about output mode 216
- KeyCtrlArrow<Up/Down/Left/Right> support HOT 1
- no pkg-config .pc file found HOT 4
- How to build demo examples.
- Documentation of the API could be more helpful HOT 1
- Is this a C library? HOT 2
- Are extended terminfo files being correctly parsed? HOT 2
- Allow reading the front buffer?
- tb_peek_event() buffers inputs with sleep_for() c++11 HOT 1
- Documentation: Termbox crystal-lang wrapper. HOT 3
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 termbox.