dev wrote:

>I want to use my own keyboard with a vxWorks.
>My keyboad has 7 keys having multiple functions depending on the type
>of GUI screen on display.
>
>How do i program for this type of keyboard ?
>Any kind of help is appreciated ..
>Thanks in advance.


Other than that you will be using VxWorks this is not really a VxWorks-
specific question, but I'll offer some advise anyway.

This problem can be divided into at least two sub-problems: interfacing
with the keyboard's switches and responding to operator input.

Without knowing anything about the keyboard except that it has 7 switches
it is hard to offer much advice for this sub-problem. If your keyboard
provides serial data output then you need to design a task that pends on
the receiving UART (or whatever). If the switches are simply read from,
a memory-mapped buffer, then you may need to design a task that uses a
timer to periodically read the buffer and debounce the data.

I like to use finite state machines to respond to operator input. Begin
by drawing detailed state diagrams and begin coding only when you are
reasonably certain that the diagrams accurately describe the desired
behavior. I prefer to code state machines using tables of pointers to
functions rather than the more obvious switch statement as the table-of-
pointers technique results in a number of small and easy to understand
functions, one for each state and sub-state, rather than the entire machine
packed into one large (often too large) function.

HTH

--
================================================== ======================
Michael Kesti | "And like, one and one don't make
| two, one and one make one."
mrkesti at comcast dot net | - The Who, Bargain