Jump to content

  • Log In with Google      Sign In   
  • Create Account


Getting the absolute mouse position with SlimDX


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
13 replies to this topic

#1 Narf the Mouse   Members   -  Reputation: 318

Like
0Likes
Like

Posted 23 September 2009 - 01:33 PM

How could that be done? Thanks.

Sponsor:

#2 MJP   Moderators   -  Reputation: 10943

Like
0Likes
Like

Posted 24 September 2009 - 02:55 AM

Cursor.Position

#3 Narf the Mouse   Members   -  Reputation: 318

Like
0Likes
Like

Posted 24 September 2009 - 03:11 AM

Ah, thanks, but I'm looking specifically for solutions using SlimDX. That is helpful in the interim, however.

#4 snake5   Members   -  Reputation: 189

Like
0Likes
Like

Posted 24 September 2009 - 03:17 AM

Quote:
specifically for solutions using SlimDX

Could you please explain why? I don't really understand the idea behind this..

#5 Narf the Mouse   Members   -  Reputation: 318

Like
0Likes
Like

Posted 24 September 2009 - 03:47 AM

Quote:
Original post by snake5
Quote:
specifically for solutions using SlimDX

Could you please explain why? I don't really understand the idea behind this..

It's for a graphics library using SlimDX.

#6 Evil Steve   Members   -  Reputation: 1959

Like
0Likes
Like

Posted 24 September 2009 - 04:34 AM

Quote:
Original post by Narf the Mouse
It's for a graphics library using SlimDX.
So? SlimDX is built on top of the Windows OS, there's no reason not to use the Windows OS to get the cursor position. The cursor position has nothing to do with graphics.

#7 Narf the Mouse   Members   -  Reputation: 318

Like
-1Likes
Like

Posted 24 September 2009 - 05:00 AM

Good point. It just bugs me that I can't.

#8 jtagge75   Members   -  Reputation: 139

Like
0Likes
Like

Posted 24 September 2009 - 05:28 AM

Why? Getting/setting the mouse position has nothing to do with the graphics API that is being used.

#9 Narf the Mouse   Members   -  Reputation: 318

Like
-1Likes
Like

Posted 24 September 2009 - 05:39 AM

Quote:
Original post by jtagge75
Why? Getting/setting the mouse position has nothing to do with the graphics API that is being used.

Gee, maybe it's the Mouse class in the SlimDX library. Having a Mouse class is generally a sign of Mouse-related data.

Now go dogpile on someone else.

#10 Flimflam   Members   -  Reputation: 657

Like
1Likes
Like

Posted 24 September 2009 - 06:16 PM

Quote:
Original post by Narf the Mouse
Quote:
Original post by jtagge75
Why? Getting/setting the mouse position has nothing to do with the graphics API that is being used.

Gee, maybe it's the Mouse class in the SlimDX library. Having a Mouse class is generally a sign of Mouse-related data.

Now go dogpile on someone else.


Gee, if you'd actually done your research you'd realize that the mouse related functionality in SlimDX is simply a wrapper for DirectInput, and in DirectInput there is no way to deduce the absolute mouse position because mouse data is all relative to its last position. There isn't even an actual Mouse class in SlimDX. It's a generic Device class that accepts a MouseState struct. If the SlimDX group were for some reason to implement this, it would no doubt simply reference Cursor.Position internally, thus be completely redundant.

Does it bug you that much that you have to get all snooty to us because you have to use Cursor.Position instead of a property that should not even really be inside the MouseState struct?

If you're writing anything using the .NET framework, you should feel no worries using a property from a critical component of the .NET framework. That's what it's there for.

I apologize if I sound irate, but there's really no reason for this to be an issue.

[Edited by - Flimflam on September 25, 2009 12:16:43 AM]

#11 Codeka   Members   -  Reputation: 1157

Like
1Likes
Like

Posted 24 September 2009 - 06:28 PM

Quote:
Original post by Narf the Mouse
Quote:
Original post by jtagge75
Why? Getting/setting the mouse position has nothing to do with the graphics API that is being used.

Gee, maybe it's the Mouse class in the SlimDX library. Having a Mouse class is generally a sign of Mouse-related data.

Now go dogpile on someone else.
SlimDX is open source. If you don't like the way they've implemented certain features, I'm sure they'd appreciate patches.

#12 robot9706   Members   -  Reputation: 103

Like
0Likes
Like

Posted 04 February 2013 - 12:48 PM

You can set the AxisMode in Properties:

_mouse.Properties.AxisMode = DeviceAxisMode.Absolute;

 

 



#13 Gavin Williams   Members   -  Reputation: 652

Like
0Likes
Like

Posted 04 February 2013 - 10:50 PM

System.Drawing.Point p = renderform.PointToClient(SlimDX.Windows.RenderForm.MousePosition);



#14 Josh Petrie   Moderators   -  Reputation: 3111

Like
0Likes
Like

Posted 05 February 2013 - 10:21 AM

 
SlimDX is open source. If you don't like the way they've implemented certain features, I'm sure they'd appreciate patches.

To be fair, SlimDX wouldn't accept such a patch since it would add functionality that isn't in the API it wraps.


Josh Petrie | Core Tools Engineer, 343i | Microsoft C++ MVP





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS