-
- Sierra
Dynamically update UI based on input?
Hey, is there a way to dynamically update UI by detecting what the input type is (keyboard/mouse, gamepad, touch)?
Does such a thing exist that I can use as a trigger to say change the Source property of an Image?
Does such a thing exist that I can use as a trigger to say change the Source property of an Image?
-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: Dynamically update UI based on input?
Do you mean in response to an event? So for a MouseDown you will do something, for a KeyDown a different thing, etc.
You can use EventTriggers for that, can't you?
If you are talking about something more generic, that knowing if game is being interacted with a mouse/keyboard, or only a gamepad, then that is something that only the application knows and can expose it in a global ViewModel that the UI can use to apply changes by using DataTriggers.
You can use EventTriggers for that, can't you?
If you are talking about something more generic, that knowing if game is being interacted with a mouse/keyboard, or only a gamepad, then that is something that only the application knows and can expose it in a global ViewModel that the UI can use to apply changes by using DataTriggers.
-
- Sierra
Re: Dynamically update UI based on input?
Hey, yes, I'm talking about a general listener whether the game is being interacted with a mouse/keyboard or with a gamepad. Our use case is that we have button prompts with icons. We would like to update those icons to keyboard/mouse ones if the user is using KB/M and to gamepad ones if they are playing with a gamepad.Do you mean in response to an event? So for a MouseDown you will do something, for a KeyDown a different thing, etc.
You can use EventTriggers for that, can't you?
If you are talking about something more generic, that knowing if game is being interacted with a mouse/keyboard, or only a gamepad, then that is something that only the application knows and can expose it in a global ViewModel that the UI can use to apply changes by using DataTriggers.
Re: Dynamically update UI based on input?
The challenge is that multiple input devices (keyboard, mouse, touch, gamepad) can be used simultaneously in Noesis, making it difficult to provide a single listener that handles all possible corner cases in your game. I believe this issue should be addressed on the integration side of Noesis. Since your engine is injecting input into each view, you could make this information available in your DataContext.
Please, let me know your thoughts about this.
Please, let me know your thoughts about this.
Who is online
Users browsing this forum: No registered users and 2 guests