Recently a weird problem has appeared. On some programs, the numpad doesn't work well. Only the number zero works: nothing else does anything except for the period button, which brings up what looks to be like an Ubuntu search dialog. For a brief moment after closing this dialog, the numbers do work, and then they don't work again. Having NumLock off or on doesn't affect anything.
I mention QT because so far this happens on TeXStudio and Mathematica, which as far as I know are QT programs, while it doesn't on others like Chrome or Gedit; everything is fine with them. Some Googling has revealed a similar problem where the number keys move the mouse (which is an option one can enable in the accessibility section), but this isn't what happens here.
What could be going on here?