Arrow keys - input commands, Computer Engineering

Assignment Help:

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.


Related Discussions:- Arrow keys - input commands

In which network configuration all data/information pass, A distributed net...

A distributed network configuration in which all data/information pass through a central computer is (A)  Bus network                            (B) Star network (C)  Rin

Symbol for the new euro currency in my spreadsheet, How can I go in the sym...

How can I go in the symbol for the new Euro currency in my spreadsheet? Ans) Microsoft suggestted a new Tahoma font with the Euro symbol.

Development of information system, Development of information system must b...

Development of information system must be considered as capital investment: The developer of an information system must think about different solutions of a particular problem and

What is the purpose of bios in a system, BIOS or Basic Input/Output System ...

BIOS or Basic Input/Output System is the first program accessed by the processor during start up to make sure that all the other basic programs, hard drives, ports, peripherals and

Determine the features of keyboards, Determine the features of keyboards ...

Determine the features of keyboards Common features on general-purpose keyboards are cursor-control keys. Functions keys are used to enter frequently used operations in a singl

What is modem?, A device, usually linked to a serial port of a computer, th...

A device, usually linked to a serial port of a computer, that transfer data over regular phone lines. Modem stands modulator demodulator; it changes a digital stream of data into s

Define process, Define Process. Process: It is a program in executi...

Define Process. Process: It is a program in execution; process execution should progress into sequential fashion. Process contains: program counter stack dat

Determine less propagation delay in synchronous-ripple ckt, You have two co...

You have two counters counting up to 16, built through negedge DFF, First circuit is synchronous and second is "ripple" as cascading, which circuit has a less propagation delay? Wh

Explain height of a tree, Height of a tree The length of the longest pa...

Height of a tree The length of the longest path from root to any node is called as the height of the tree.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd