"to cheat, swindle," 1806, from dial. duddle, diddle "to totter" (1632). Meaning "waste time" is recorded from 1825. Meaning "to have sex with" is from 1879; that of "to masturbate" (especially of women) is from 1950s. More or less unrelated meanings that have gathered around a suggestive sound.
1. To work with or modify in a not particularly serious manner. "I diddled a copy of ADVENT so it didn't double-space all the time." "Let's diddle this piece of code and see if the problem goes away." See tweak and twiddle. 2. The action or result of diddling. See also tweak, twiddle, frob. [Jargon File] (1995-01-31)