Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Problem processing keystrokes in QNX program through telnet : (1 Item)
   
Problem processing keystrokes in QNX program through telnet  
I'm working on a project where there is a preexisting QNX 4.25 program that interacts with certain hardware. The program
 allows user input to set various options through the keyboard, one of those options being terminating the program when 
'9' is pressed.

I'm tasked with creating a Windows interface that allows a user with no knowledge of QNX to be able use this hardware. 
I've created a GUI that can connect and log the user into another computer through telnet. Now I've begun manually 
testing running the QNX program through telnet, and while I can successfully run the QNX program through telnet, it 
seems that at run time, the program does not respond to my keystrokes.

When running the program directly in QNX, I don't experience this problem. If I press 9, the program ends, and all the 
other keystrokes result in appropriate actions.

The program is multithreaded, and the loop that handles the keystroke comes after the threads are started. If this is 
any help, here are the parts of the program that deal with those keystrokes:

[code]
   while (loop) {
      if ((keystroke = wgetch(win)) != ERR) {
         flushinp();
         processKeystroke(keystroke);

         if (keystroke == '9') {            
            processKeystroke(keystroke);            
            loop = FALSE;
         }
      }
   }
killthreads();
[/code]

and here is the processkeystroke function:
[code]

void processKeystroke(char keystroke)
{
   switch(keystroke) {      


      case '0': // startup
                ........................
                case '9':
               /* code to tell hardware to stop running */
break;
}
} 
[/code]