1821, "squint-eyed," perhaps from cock (v.) in some sense + eye (n.). Figurative sense of "absurd, askew, crazy" is from 1896; that of "drunk" is attested from 1926. Cockeye "a squinting eye" is attested from 1825.
that's a cockeyed idea
cockatrice
cockchafer
cock-crow
cocker
cockerel
cockeyed
cock-fighting
cockhorse
cockle
cockney
cockpit