Path: csiph.com!news.mixmin.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: Parsing multi-byte keystrokes Date: Mon, 26 Jun 2023 01:39:52 -0700 Organization: None to speak of Lines: 16 Message-ID: <871qhy1usn.fsf@nosuchdomain.example.com> References: MIME-Version: 1.0 Content-Type: text/plain Injection-Info: dont-email.me; posting-host="a44f767d52f7a9230c899799d3560062"; logging-data="949624"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18jK9WKCXxFeUw4Dw66V8tu" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:XOijvVmQVlg8i/Ou1qvUws9hIiU= sha1:4rjdpAym6dcmC8ElD1PIS//MB70= Xref: csiph.com comp.lang.c++:90731 "R.Wieser" writes: >> On Linux (strictly speaking, on a GNU system) specifically, try readline >> function. > > The problem with that is that I need the keys at the moment they are pressed > (and released ?), not only after "enter" is pressed. You might take a look at the readline source code to see how it does that. It's certainly able to recognize the user pressing up-arrow (which typically sends Esc-[-A) and acting on it immediately, even if it doesn't expose that ability directly to the user. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */