CompuServe Thread

#Intermixed Raw Reads

2 messages in this thread
#32149From: Paul WhittemoreJan 26, 1989 12:00 AM
Now _I_ don't want to write a custom console device, especially when ConMan's available, so if you could just add the following, I'd… I'd… I'd stop asking for source! Well, don't get your hopes up… If you'd prefer not to have slightly modified versions all over the place (my usual reason for restricting source code), how about sending me a hard-copy listing… (I hate typing, you're safe `:v) Anyhoo, back to the subject. A 'minor' enhancement to ConMan would open new worlds for me and probably many others. My biggest complaint with current console handlers is that they seem to process (in addition to buffering) the keystrokes as they are typed. I believe it's much more practical to process the keystrokes as they are _requested_ by the calling task. More to the point: could you add a new packet command allowing RAW reads (16-bit characters, high-byte qualifiers, low-byte raw key (scan) codes (or even some variation on ASCII). With this packet, we could easily have getchar() and rawgetchar() functions, without the need for setraw()/setcon() [Manx] functions and special "enter mode" packets (which as I said before have timing windows and are not exactly to the point of what we're trying to do anyway…) The key would be buffered, and returned raw if the next read requested it that way, or mapped if a standard read was requested. Simple and to the point. Maybe CND: avoids the (timing) window (I think it will theoretically), but let's fix it at the root of the problem. This is something I've wanted for a LONG time…
#32382From: Bill HawesJan 27, 1989 6:09 PM
The problem with allowing raw reads is that then the console handler can't make any sort of rational display. For example, suppose that you've typed a few characters and they're displayed on the console, and taht the read task has already read them. What do you do now when you type a backspace? You can't ask the task to give back the character it read … If you're willing to undertake responsibility for rendering the display, you can always to character-by-character reads from RAW:. The issue of whether you get the qualifier keys depends on the keymap in place, but in principle you can get anything you want, at a cost of more processing required on your side.