That was it! The culprit seemed to be a rather poorly written app from our city's public transit company, that is supposed to use NFC to read transit card info, but actually never works. The keyboard issue appears to be gone with this app removed.
Thanks for the tip! I'd never have guessed it, the app wasn't active or even open as a background process.