Ahh, on-screen keyboard. Yeah, that won't work for the same reason Joy2Key and the like don't work. MAME uses advanced Windows functionality ("XInput") in order to properly support multiple keyboards/mice/lightguns and a lot of software of that nature isn't programmed properly to work properly in that situation (they're supposed to use a driver and appear as a real input device; most of them cheat instead).