HELP: How do I generate function and special key signals???

1. Function keys under X-Windows: Why do the generate the keys they do?

I think this is not a Linux question per se, but rather one related to
XFree-86 in particular and probably to IBM PC hardware based X servers in
general.

The question is: Why do the (IBM-PC) function keys generate the sequence of
keys that they do?  I have found the following:

        keys            chars generated
        =====           ===============
        F1-F5           {esc}[1[1-5]~   (That is, escape, bracket, 11-15, tilde)
        F6-F10          {esc}[17-21]~   (That is, escape, bracket, 17-21, tilde)
        F11-F12         {esc}[23-24]~   (That is, escape, bracket, 23-24, tilde)

I have two questions:
        1) Why the funny sequences in general?  I suppose this is more of a
           historical question than anything else.
        2) Why the weird numerical sequences (11-15, 17-21, and 23-24) ?

************************************************************************
    "We trained hard -- but it seemed that every time we were
    beginning to form into teams, we would be reorganized.  I
    was to learn later in life that we tend to meet any new
    situation by reorganizing.  And what a wonderful method it
    can be for creating the illusion of progress while producing
    confusion, inefficiency, and demoralization."
                        --  Gaius Petronius Arbiter --
                            (First Century)


          hundreds, if not thousands, of dollars, every time he posts -
************************************************************************
rwvpf wpnrrj ibf ijrfer

2. Compiling SatTrack 3.1.5 on RedHat 4.1

3. special function keys under xview

4. tcp connections terribly slow (SuSE 7.2, kernel 2.4)

5. lost first 4 of 6 special function keys in vim with xfree86 3.3.1

6. Thanks Steve Ackman

7. laptop special function keys did not work under linux (suse 8.2)

8. How to read AnswerBook from SunOS 4.1.3???

9. special function key killing v.consoles in laptop

10. \\\ Professional Images Virtual Domains/// Special Special Special Special

11. Command key as special key for personal commands

12. Function of Keys ALT-CTRL key combinations

13. Processing arrow keys, function keys, etc.