Page 1 of 1

The eternal numlock question

Posted: Sat Aug 15 2020 6:52 pm
by seasoned_geek
This seems to surface in the Qt world quite often. I was wondering if CS had finally added some wrapper classes for retrieving and setting the NumLock state.

Do we have to use one of these two or has a method been added?

https://stackoverflow.com/questions/24822505/how-to-tell-if-shift-is-pressed-on-numpad-input-with-numlock-on-or-at-least-get

https://www.qtcentre.org/threads/30180-how-to-determine-if-CapsLock-is-on-crossplatform

I too am in a situation where life would be bright and beautiful if there was a

bool QApplication::getNumLockState()
void QApplication::setNumLockState()

because ideally I would like to save the state and restore it, forcing it on during application run and when the application regains focus. I'm coding around it for now, but it would be nice if there was a method. I'm not testing these Diamond modifications on any platform other than Ubuntu 20.04 so any OS specific stuff I coded would be untested and most likely stolen from some place online.