Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

SlimDX RawInput and WPF

4: Adsense

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   

292
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.




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.