CHAPTER 19Instant Keyboard Response

There are times you may want to enter some input or perform an action without having to use the Enter key. A while back, I encountered this problem when I needed to view the numerical output of ballistic equations. I wanted to be able to increment or decrement an input value and recalculate the results by pressing just one key. I came up with a script that would do this, and display both the changed input value and the new results calculated from it. The example script here, while interesting, is just a simple demonstration of how to process instant response.

My script accomplished its task quite well. The following script is a simplified version that calculates and displays the values for a projectile's trajectory. ...

Get Expert Shell Scripting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.