From the custom of uncovering the head (abridged to ‘raising’ or merely ‘touching’ the cap) in sign of reverence, respect, or courtesy, come many expressions, such as to come with cap in hand, also cap-in-hand, attrib. phr., with cap and knee, bareheaded and bowing or kneeling, with cap and courtship, or cap and curtsey; and also the contextual use of cap, for the raising of the cap, respectful salute.
1600HOLLANDLivy IX. xx. 328 They..importuned them..with cap and cursie.
1889C. M. YONGE in Monthly Packet Xmas 33, I don't care for those cap-in-hand ways of your people here. OED
Neil Steinberg's Hatless Jack is a quick read full of interesting anecdotes that exhaustively covers the rise and fall of hat fashion in America. What's really useful is its excellent bibliography.
There are a remarkable number of works on hats available through Google Books, some with just the bibliographic information but many full text, out of print works too.
a. trans. To cover with a hat; to furnish or provide with a hat. Also, to bestow the cardinal's hat upon. c1430 Pilgr. Lyf Manhode II. cxxii. (1869) 121 Al be it I be mantelled and wel hatted. 1598 FLORIO, Incapellare..to hat one. 1852 W. JERDAN Autobiog. II. xiii. 164 We had..hatted and cloaked ourselves. 1885 Boston (Mass.) Jrnl. 31 July 1/6 The Pope..held a public consistory..at which the newly appointed Cardinals were hatted. 1891 A. THOMAS That Affair I. x. 171 Miss Polthuan hats and veils herself.
b. To place one's hat on (a seat) so as to claim it. 1886 Philad. Times 10 Apr. (Cent.), Twenty seats had..been hatted before noon to secure them for the debate.
c. intr. To work alone. (Cf. HATTER n. 2.) Austral. 1891 Age 25 Nov. 6/7 (Morris), Two old miners have been..hatting for gold amongst the old alluvial gullies. 1900 H. LAWSON On Track 88 And he ‘hatted’ and brooded over it till he went ratty. ref