Arrow keys - input commands, Computer Engineering

When the user is inputting commands into your shell, it should identify the left, right , up and down arrow keys. To implement this, you will need to use the termios.h library to configure a custom input strategy. Remember that after changing the configuration, you should restore it to its original configuration before exiting the program. Also, change the reads to be non-canonical and disable echoing. This will give us control on how to handle each character the user inputs. It is tricky determining which character is left, right, up or down . Most characters are only one byte long. On the other hand, the character that is output when an arrow is pressed, is three bytes long. Here are the three byte sequences for left, right, up and down arrows:

l e f t --> {27 , 91 , 68}

r i g h t --> {27 , 91 , 67}

up --> {27 , 91 , 65}

down --> {27 , 91 , 66}

 Since we are not echoing characters, you will need to echo every character the user types. If left or right key is pressed nothing should happen. But if up or down arrow key is pressed it should work as described in the History section below.

Posted Date: 4/3/2013 2:57:26 AM | Location : United States







Related Discussions:- Arrow keys - input commands, Assignment Help, Ask Question on Arrow keys - input commands, Get Answer, Expert's Help, Arrow keys - input commands Discussions

Write discussion on Arrow keys - input commands
Your posts are moderated
Related Questions
Single Instruction and Single Data stream (SISD) In this organisation, sequential implementation of instructions is executed by one CPU having a single processing element (PE

to find the area under curve

Q. Hardware required for superscalar processing? For applying superscalar processing a number of special hardware should be offered that is discussed below: • The necessity

Design two matlab algorithms for enlarging the 256x256 images into 512x512 images by using bilinear and bicubic interpolations   a)  Evaluate the interpolated images with the

Q. Explain working of Digital camera? A Digital camera is a camera which captures and stores still images and video (Digital Video Cameras) as digital data in place of on photo

Q. Describe about Physical Systems? Physical Systems are tangible entities which may be dynamic or static.   Computer Systems, Buildings,Vehicles etc. are illustrations of p

A common task for a system administrator is to create new user accounts. In this lab you will be creating output that looks like an /etc/passwd file. The Problem You are to

Design issues:  To complete the maximum processor utilization in a multithreaded architecture, the following design issues have to be addressed: Context Switching time: S


Dynamic screen sequence  for a  screen can be set using which commands? It uses two commands:- A) Set Screen B) Call screen.