Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


SlimDX RawInput and WPF


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
No replies to this topic

#1 NickUdell   Members   -  Reputation: 288

Like
0Likes
Like

Posted 23 February 2013 - 07:54 AM

I'm trying to set up keyboard and mouse controls for a space game using SlimDX and RawInput. My current code is as follows:

 

Device.RegisterDevice(UsagePage.Generic, UsageId.Keyboard, DeviceFlags.None);
Device.KeyboardInput += new EventHandler<KeyboardInputEventArgs>(keyboardInput);
Device.RegisterDevice(UsagePage.Generic, UsageId.Mouse, DeviceFlags.None);
Device.MouseInput += new EventHandler<MouseInputEventArgs>(mouseInput);

 

 

However I read here: http://code.google.com/p/slimdx/issues/detail?id=785 that for WPF I need to use a different overload for Device.RegisterDevice(), as well as assigning a HandleMessage using Device.HandleMessage(IntPtr message)

 

I've found the correct overload for RegisterDevice() which is:

RegisterDevice(UsagePage usagePage, UsageId usageId, DeviceFlags flags, IntPtr target, bool addThreadFilter)

 

 

 

What I can't work out, though, is:

 

1) Now that I have to use a target, what am I meant to set as a target?

2) Where do I get this IntPtr message from?


Sole Creator of Pigment - a procedural, block-base space trading sim.

PhD student working on medical imaging at the University of Southampton.

Enjoyer of games, films, books and cider.

Sponsor:



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