Detecting keypresses before startup

BlitzMax Forums/BlitzMax Programming/Detecting keypresses before startup

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hey TomToad, thanks for the reply. This reminds me actually that although the system might maintain track of whether shift is being pressed or not, and also for the other modifiers including capslock, it doesn't actually sense that the key is being pressed, it only senses that it `was pressed`, and only recorded a state change when the press first began, regardless of whether it is ongoing, and only changes back when the key is released. So yeah, since it actually deals in keypress events rather than looking at the keyboard and sensing if the key is `being pressed`, I guess there's no real way to detect the overal state of these modifiers.

It would be nice to be able to grab the current state from the system, ie since Windows/Mac/Linux is itself keeping track of whether shift is up or down, etc, if Max could get that information and start out with it as its internal state, that would work. But alas I guess this isn't too likely.

I think what I will do is my earlier suggestion - write false to a file, try to open fullscreen, if it fails then the next time the app is run it reads the file and finds false there, so it knows to open in a window. I only really need to handle this one situation, even though multiple modifiers would be cool.

I don't want to use command line arguments because hardly anyone knows that a command line even exists, let alone how to use it.

Is it possible to have the user shift-click in the desktop, clicking on a file and shift clicking on my game app, then have the path of the dummy file pass into Max? If that would work I'd be able to use the dummy file as a `trigger`, ie say `click the "window mode" icon, hold shift and click the game` to run it in window mode?

Or, I guess I could distribute two copies of the game, one that runs in a window and one that runs fullscreen?