Jarryd
Topic Author
Posts: 14
Joined: 05 Sep 2023, 07:25

Multi User views

21 Feb 2024, 08:06

Wpf and UWP are windows PC UI frameworks.
So they assume a single user, and that's fine.
A computer with four mice does not have four cursors.

Noesis on Xbox and Playstation break that assumption, by having multiple game pads with a unique gamer (or guest) each.

The noesis Gamepad triggerclass allows me to respond to Gamepad input, via interactivity triggers. But there is no player index value as I expected.

https://www.noesisengine.com/docs/App.I ... igger.html

What is the correct way to build multi user interfaces in Noesis?
 
Jarryd
Topic Author
Posts: 14
Joined: 05 Sep 2023, 07:25

Re: Multi User views

28 Feb 2024, 06:56

One approach, would be to store a "focused" element for each gamepad present in any given view.
If I have my own GamepadTrigger implementation, that is aware of a player index then I can do the following:

Have my own Button with four depenenency properties for "FocusedPlayer1", "FocusedPlayer2" etc...
The usual `Focused` state is ignored and only used for attempting navigation.

When input comes from a given gamepad index, navigate focus from their stored control in the direction they want to go. Up, down, left, right, forward or back.
Store whatever they land on, and flip that index's DP to be focused for that index.
If they click\press A, then their command goes off, taking the index in as a parameter.

To fill in this new GamepadTrigger, I can reach into the game engine and bypass Noesis.

It's a rough idea I'd like to chuck out here, before investing some hours in prototyping it.

Any thoughts?
 
User avatar
sfernandez
Site Admin
Posts: 2997
Joined: 22 Dec 2011, 19:20

Re: Multi User views

04 Mar 2024, 11:50

Hi, sorry for the very late reply but we were trying to get our heads around this problem.

One way to be implemented from outside is by specify some attached property to define if a control is being controlled by any specific gamepad (so you can use this to show some visual cue in your templates), and then manually update that property handling the input yourself:
- Using FrameworkElement::PredictFocus to determine which element would get "focused" by the controller when a directional key is pressed
- Using UIElement::RaiseEvent to raise PreviewKeyDown/KeyDown (and Up) events on the control "focused" by the controller to action it

I think this is similar to what you are proposing but on higher level than GamepadTrigger, because that trigger only works on focused elements, and only 1 element can have keyboard focus at the same time.

But even this approach has some caveats. There are controls that are not prepared to work with multiple controllers. For example, if you have a couple of ComboBoxes, only one can be opened at the same time, because that control relies on MouseCapture to open/close the drop down.

So to fully support multi-controller we need to do some internal changes. The first thing we might wanna try is to handle mouse input as a touch device, so it can support many at the same time. And then adapt all controls logic to work on multi-touch environments. Could you please create a ticket about this topic, we need to think and discuss more about this.

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 6 guests