is it possible to use the new 2.0 GUI elements with other input devices than mouse keyboard? Is there a way to read input from a device then “emulate” keyboard/mouse input to the GUI elements? There is, for example, a function called GUI.FocusControl(name), however it is unclear what is this name that is referred to here.
Thanks for the reply! Actually we will likely need to control the gui by a game pad and eventually with some other control device that does not have direct Unity support at the moment. Currently we read it through a plugin.
I.e. the mapping idea is good, I’m not sure though if a plugin code can be used to inject the appropriate events for the Unity input system at the moment?
Not that I’ve tried it, but I imagine you could in the worst case do this manually. As in, keep track of which control is ‘highlighted’, draw it with a ‘highlighted’ style in the GUI update routine, change the highlight in response to gamepad directional presses, trigger the same routines when they press a button as you would when they click on it. Might be a little harder for some controls than others, but since everything’s controlled frame-to-frame by instance variables anyway I’d think it’d be doable.
But again, I haven’t tried so take this with a grain of salt =)