Setting up inputs via script... But can I detect which system I'm on?

So, I’ve been wondering if it’s possible to set up input controls via script. I haven’t done too much research but I want to hope that it’s do-able (though it might require some higher-order coding chops.)

But with that in mind, is it possible for a script to detect which system it’s on?

So, for instance, if I’m on a PC/Mac the script will be all “Hey, I’m on this system so let me set up the usual mouse/keyboard control setup and leave a couple inputs for a game pad controller in case one is detected.”

Or if I’m on the Playstation (PSN) it’ll go “Well then, I guess I’m on one of Sony’s consoles so let me get this set up for that kind of system.”

Etc, etc… I hope by now you can grok what I’m getting at here… So, do-able? If so, can you post any links to resources that you know of please? Thanks!

You probably want to check out platform dependent compilation.

In most cases it makes sense to check for the platform when you build, and strip out any code unrelated to that build. Checking at runtime can be done, as indicated by @hpjohn . But its normally not the best option.