Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3509 Members - Latest Member: lioneltenel

27. May 2012, 03:27:15 am
Xith3D CommunityGeneral CategoryFeature Requests & Brilliant Ideas (Moderators: Marvin Fröhlich, 'n ddrylliog)Focus management
Pages: [1]
Print
Author Topic: Focus management  (Read 2305 times)
Mathias 'cylab' Henze
Fierce Warrior
****
Offline Offline

Posts: 540

1064620
View Profile WWW
« on: 28. March 2008, 02:42:31 pm »

Is there some utility class available that can handle focus changes and redirecting of input events (mouse and keys) to the newly focussed object? Maybe some implementation in HUD?
Logged

Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 28. March 2008, 02:44:52 pm »

Is there some utility class available that can handle focus changes and redirecting of input events (mouse and keys) to the newly focussed object? Maybe some implementation in HUD?

I'm not sure, if I see, what you mean. The HUD has a focus management. But what do you mean about the "newly focussed object"? Are you talking about general 3D objects like shapes or just widgets on the HUD?

Marvin
Logged
Mathias 'cylab' Henze
Fierce Warrior
****
Offline Offline

Posts: 540

1064620
View Profile WWW
« Reply #2 on: 28. March 2008, 02:52:53 pm »

I am speaking of general 3D objects.

An example, let's say:
- In my spline editor I move the scene around by pressing the cursor keys
- When I click on a spline, I want to move the spline with the cursur keys
- When I click on a control point, Ii want to move the control point
- etc.

For this to work I need to redirect the current input events to the component I use. Maybe "focus" is the wrong concept here, it's more like en exclusive mode inputlistener!?
Logged

Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #3 on: 28. March 2008, 04:14:05 pm »

Hmm.. Wouldn't this be simply done by a class, that keeps mappings of InputListeners to Transformables and which is a PickListener. On a pick event it would active one of the mappings and deactivate to previously active one.

But to answer your initial question: No. This isn't available so far as a untility.

Marvin
Logged
Mathias 'cylab' Henze
Fierce Warrior
****
Offline Offline

Posts: 540

1064620
View Profile WWW
« Reply #4 on: 28. March 2008, 05:26:36 pm »

OK. I'll try to come up with a solution in my game and will discuss the results and a possible generalization to the xith3d codebase, when I have something working. And you are right: shouldn't be to complicated to achieve this the way you describe it.
« Last Edit: 28. March 2008, 05:37:34 pm by Mathias 'cylab' Henze » Logged

Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #5 on: 28. March 2008, 05:36:33 pm »

If the objects are moved uniformly (by the same code), you might not even need those mappings, but you could simply activate an object to be handled by the InputListener.

Marvin
Logged
Mathias 'cylab' Henze
Fierce Warrior
****
Offline Offline

Posts: 540

1064620
View Profile WWW
« Reply #6 on: 28. March 2008, 05:46:46 pm »

I thought about a FocusManager that has two ways of registering InputListenrs:

- Mapping of a 3D Object to an InputListener implementation
- Registration of a 3D Object that implements a Focusable interface that contains a getInputLister() method
Logged

Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #7 on: 28. March 2008, 05:54:07 pm »

Sounds good. But how about calling it Activatalbe instead of Focussable and ActivationManager instead of FocusManager to avoid mix-up with GUI systems' focussing terms?

Marvin
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic