Path: csiph.com!weretis.net!feeder8.news.weretis.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: Fri, 30 Jun 2023 13:45:51 -0700 Organization: None to speak of Lines: 45 Message-ID: <877crksmps.fsf@nosuchdomain.example.com> References: <1t4nM.1647$fNr5.933@fx16.iad> <8735293xdb.fsf@bsb.me.uk> MIME-Version: 1.0 Content-Type: text/plain Injection-Info: dont-email.me; posting-host="bc073a0f8b755b0a94091368463b169c"; logging-data="2781019"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+IWexBQ5CrWGdnfUKLEyY/" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:hBLUc9OMPIKy3h3HE/GqjvxSTA4= sha1:evDwqh5s973e+P4fCLGNLVxxQ34= Xref: csiph.com comp.lang.c++:90800 "R.Wieser" writes: >> As far as I can tell there /is/ a solution, but this, being a C++ >> group, is not the best one for the question so maybe no one has >> given the details. > > I assumed that a good percentage of users here would be using Linux, and the > question would make sense to them. I must have assumed wrong. And yet you're still posting here and *not* posting in an appropriate place. Why? >> ncurses provides a function to do this parsing with and without >> a timeout. If that is not, in fact, what you want then you should >> explain why ncurses's "keypad" setting does not do what you want. > > I would need to install it (its not part of the OS installation) and I've > heard that its a bit "demanding" : > > [quote=Alf P. Steinbach, Sun, 25 Jun 2023 15:06:29 -0700] > curses takes over the entire (text / terminal) screen, keeping track of what > character is shown at each location and using minimal output to update it as > needed. > [/quote] You see, this is why you should leave attribution lines alone. Alf Steinbach didn't write that. I did. (He quoted it in a followup.) > Which is /absolutily not/ what I'm currently looking for. Thats like using > a cannon to kill a mosquito. I have no problem with using a cannon to kill a mosquito. If ncurses had a good way to detect arrow key input without taking over the whole screen, I'd recommend that. Thomas Dickey, in response to a question I posted on Stack Overflow a few years ago, suggested something that might be the basis of a solution: https://stackoverflow.com/q/48715793/827263 https://stackoverflow.com/a/48716136/827263 -- 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 */