Virtual keyboards (for touchscreens or gaze typing) aren't mechanical. Those projected "keyboards" aren't mechanical. Fingerworks TouchStream isn't mechanical. Those point-of-sale membrane keyboards with no domes/switches or keycaps probably aren't mechanical. LightIO isn't mechanical, because it uses optical sensing without any moving keys or anything like that.
The distinction isn't purely theoretical either. There's been, for example, some academic research, that compared "mechanical and non-mechanical keyboards", specifically keyboards with physical keys and large touchscreen keyboards (e.g., on an iPad) wrt their respective impact on hand strain.
Meanwhile, the local twisted definition is a mess too, because it ignores "moving parts" and draws artificial lines between different actuation technologies and specific materials used (e.g., a metal spring). Then, optical switches from Flaretech are less "mechanical" than Cherry MX, capacitive Topre switches are less "mechanical" than ordinary membrane with pressure actuation, IBM Model M is less "mechanical" than again Cherry MX etc.