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: Sun, 02 Jul 2023 15:39:42 -0700 Organization: None to speak of Lines: 76 Message-ID: <877crix7ip.fsf@nosuchdomain.example.com> References: <1t4nM.1647$fNr5.933@fx16.iad> <8735293xdb.fsf@bsb.me.uk> <877crksmps.fsf@nosuchdomain.example.com> <87zg4fqx07.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Info: dont-email.me; posting-host="51a050befc0255bef2a3c1696b4bff00"; logging-data="3618952"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18pzyxjUqdiFKaQe4FZdgDC" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:Oo6BYUoRtkHx0q+x/CAAxgKid+Q= sha1:BaLuZ9GKBUpzqsK5uCr5bDjhWi4= Xref: csiph.com comp.lang.c++:90823 "R.Wieser" writes: > Keith, > >> You could post a single message on this thread saying that >> you're going to continue the discussion in comp.unix.programmer. > > Ah yes, about that : Are you aware that Linux != Unix ? I might well be > told to leave that group for the same reason you are trying to eject me from > this one ... Yes, I'm aware. At least the first part of your original question was not specific to Linux. Recognizing arrow keys on input, for example, can be done using interfaces defined by POSIX, which is supported by all Unix-like systems. The curses interface (which provides similar functionality in a way that doesn't quite meet your requirements) is defined by POSIX. You mentioned the "console", apparently referring to the Linux virtual console, but in most ways it behaves very similarly to any other modern terminal emulator. I'm not the only person who has suggested that comp.unix.programmer would be a better place for your question. Apparently you'd rather stay here and argue with people who are trying to help you. Detecting modifier keys (shift, control, alt) separately is another matter. It's impossible in some contexts. Detecting them on a Linux virtual console is probably possible, but I don't know how. That might be a question for a Linux-specific newsgroup; I don't know which one, but perhaps something under the comp.os.linux.* hierarchy. "man console_codes" might be helpful; it does discuss modifier keys. >> You can still do that. It would be far less rude than what >> you're doing now. > > Which is ? That I ignore your "I'm a Windows C++ programmer and could not > care less about the Linux C++ programmers that are here" attitude ? No, you've been posting here repeatedly without asking anything that's specific to C++. [...] >> You skipped the part where Thomas Dickey demonstrated using >> ncurses without taking over the screen. > > Lol. > > Third paragraph, first sentence : > > "Here's a *non-working* example of what I'm trying to do." > > (bolding by me). Yes, I know. I wrote that in my question. > A quick peek at the result could have told you the same : > > " > Press UP, DOWN, Escape, LEFT, RIGHT > Incorrect input: (-1, -1, -1, -1, -1) > " > > He even mentions the "intimately tied to taking over the entire screen" as a > standing problem in his "update" paragraph. Yes, *I* wrote that as part of the *question*. I was suggesting that you read Thomas Dickey's *answer*. (FYI, he's been maintaining ncurses since 1996.) Don't expect any more help from me. -- 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 */