There is QApplication::keyboardModifiers(), but I think it has the same problem.