Click to See Complete Forum and Search --> : Getting caps lock status in Qt


gamblor01
03-19-2008, 06:13 PM
Does anyone know how to get the status of the caps lock key in a Qt application? KDE knows the status so it must be possible to do in Qt but so far the only thing I have found is that windows.h will allow you to do it...but I need a solution that is cross-platform.

I tried checking out several of the kde packages in SVN and doing a grep to find information about caps lock but I haven't been able to figure out how they're doing it. Anyone have any advice?

cybertron
03-20-2008, 04:23 PM
Unfortunately I don't see any easy way to do it either. If you're not opposed to linking against SDL you can try GetModState (http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fGetModState) which seems like it does what you want. Or you can look at the source for GetModState and figure out how they did it.