Dear Daniweb,

I am currently doing a commandline for a rabbit module.

Using Dynamic C.

Do you know how to code to recognise user's key strokes?

Like if user press UP, it will display the previous command typed.
If user press DOWN button, displays next command typed..

Some articles, help files or references are appreciated too!

9 Years
Discussion Span
Last Post by jephthah

conio is a windows-only library thats nice when it works, but god help you if you ever have to port code that relies on it.

termios and/or ncurses is a posix solution that might be more likely to yield results on your niche application.

or maybe it wont. i dont know. you're outside standard C now, so who knows what will happen.

FWIW, you can start here



Its a Rabbit Microprocessor. Rabbit is the manufacturer

Dynamic C is a dialect of C, the Dynamic C language has all the statements and constructions of traditional C, plus extensions that make it easier to write reliable, real-time multitasking software.

But I want to get some suggestions with the normal ANSI C will do, maybe I can tweak a little...


there is no "normal ansi C" that standardizes the bazillion different possible terminals into one set of interfaces.

termios is the closest you'll get and even it has issues.

sounds like you'll need to dig down into your assembly code and roll your own interrupts.


Under windows, keystrokes work as messages.

The message queue reader tells that the key has been preseed because it has been released.

So, the key is formally pressed when it finally has been released.

So every key can act as the "shift" "alt" and any other keys, in which the program cant act differntly while one ore more keys are pressed.

So, in summary a key press is defined like a key down followed by its respective key up.

Hope helps.

Votes + Comments
You don't deserve neg rep for this -- even though is isn't of use the the OP.
just stop.

WHAT are you going on about? we're not talking about Microsoft's Windows Server OS, he's using the "C Language" to program a "microcontroller". perhaps you've heard of these things?

nine posts, and all you've done is add confusion and nonsense. if you cant contribute anything remotely relevant, just go on an' git.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.