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..

Thanks!
Some articles, help files or references are appreciated too!

what operating system? Dynamic C -- never heard of it.

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

http://www.rabbit.com/products/dc/index.shtml

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.

thanks will try that..

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.

commented: just stop. -1
commented: You don't deserve neg rep for this -- even though is isn't of use the the OP. +16

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.