Disassociate mouse with its position

Started by
11 comments, last by _WeirdCat_ 9 years, 2 months ago

DirectInput is officially deprecated for keyboard and mouse.

Unfortunately it has one nifty advantage: All the possible buttons/axis/etc. of a gamepad/joystick get human readable names assigned, and you get calibration info; something I haven't gotten from RawInput.

In my engine I use RawInput plus DirectInput to match up controller info.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

Advertisement

DirectInput is officially deprecated for keyboard and mouse.

Unfortunately it has one nifty advantage: All the possible buttons/axis/etc. of a gamepad/joystick get human readable names assigned, and you get calibration info; something I haven't gotten from RawInput.

In my engine I use RawInput plus DirectInput to match up controller info.

MS still says use DI for gamepads that are not Xinput pads, otherwise cast the void* to the game state you expect to get back from your device.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

my apporach for this pbolem is: every frame you set cursor poision to the center of the screen

so code looks like:

ttagpoint actpos;

ttagpoint lastpos;

GetCursorPos(&actpos);

SetCursorPos(screenwidth/2, screen.height /2);

diffrenece between actpos and lastpos is your movement

lastpos = actpos;

This topic is closed to new replies.

Advertisement