there are indeed keyloggers that do this, but it wasn't common in the early 2000s when most of these on-screen keyboard setups were implemented.
Of course, a physical keylogger is a different beast, but really, if you got physical access enough to install an actual piece of hardware...