Hotkeys in Shell script

Experts,

I am currently writing a shell script to access the Multiple scripts in a Menu based format for the Users. Users will be accessing the scripts inside this via numbers.

Now I would like to know, is it possible to create Hotkeys in my Shell Script? Say for example, Press F1 for home page, F2 for Script exit etc.

If yes, please help me how to accomplish it.

Just try to read them:

$ read A
^[OS
$ echo "$A" | od -tx1
0000000 1b 4f 53 0a

And then, interpret correctly. Above was for <F4> . Be aware that terminals may send different codes than e.g. PC consoles.