#terminal input delay
1 messages · Page 1 of 1 (latest)
Second of all how to get multiple ket strokes ? When i press two keys at once then it only get one of these two. It's not even queue these keys.
Nothing you can do about that, thats just how he display server sends input
And since theres no way to see if you released a key, you cant really know whether its from a repeat or an actual key press
They should both be sent as characters into stdin, make sure youre not flushing the stream or reading the entire thing per key
so these two keys can be described in one slice that is returned from read() function ?
cause now i read it take one key and discard the rest
If theyre pressed at the same time yeah
Yeah thats an issue
The easiest way rn is to just not discard it and read it next frame
But ofc now stuff will never visibly be pressed at the same time
is it really display server or is it fault of terminal stdin, cause i saw once smooth input fetching in some project , but it used device x11 library ? So maybe it is possible to have smooth input.
terminal emulators don't provide the functionality to get key up events - the display server has nothing to do with it
What you get in stdin is exactly what the terminal gets from the display manager
If you want more fine tuned controls you can access the keyboard state directly with libudev or x11 or whatever
But thats generally not something tui apps should do imo
do you mean when there is a fullscreen terminal at boot? most of the time you use a terminal through a terminal emulator which is receiving events from x or wayland
The display server sets the repeat rate and sends the key events :p
At least as far as i know
the terminal emulator decides what to send to your program's stdin
X and wayland is what i mean by display server
x and wayland both provide key up events, the terminal emulator just doesn't pass them on to your program
yeah
I agree with you i think theres just a misunderstanding
Dw about it
thanks
if you really need this, using x11 apis isnt a bad choice
Just be careful ig
Since there isnt really an appropriate alternative on wayland since you cant get input events without a window you create being focused