The Online Etymology Dictionary explains the origin of the word gadget as follows:
1886, gadjet (but said to date back to 1850s), sailors' slang word for any small mechanical thing or part of a ship for which they lacked, or forgot, a name; perhaps from Fr. gâchette "catchpiece of a mechanism" (15c.), dim. of gâche "staple of a lock."
This means that the word was not used for small electronic devices in the beginning. After all, it would be quite hard to find any Blackberrys, Kindles and IPods back in the 1850s...
What about the current usage of the word gadget? Is it restricted to electronic devices? Or is it still used more generically as in the original meaning of the word?