Hi,
I am new here. Since the appearance of XP SP2 and now Vista, it is necessary to port my CAD system ("DESI-III" http://users.telenet.be/desi-iii ) to Windows. It was/is written in Fortran for DOS, - converting to an other language is out of the question -, but I am still looking for a decent freeware graphics library for Windows. I am lurking now to Allegro, and it fulfils all my wishes except for one thing: It doesn't has access to mouse mikeys. (mikeys are NOT the moves in screen pixels since the last call/event, that's a relative change of screen position, but the number of hardware steps the mouse made since the last call. The sensitivity of the mouse is defined by the proportion "mikeys per pixel".
If I could have access to that, Allegro seems perfect for my goal. At the same time other users could profit from it as well for a local sensitivity setting of the mouse in their applications.
Thanks in advance,
Hugo
get_mouse_mickeys() is the Allegro command you're looking for.
EDIT: However, Allegro already has mouse sensitivity settings built-in. Check out the set_mouse_speed() command.
--- Kris Asick (Gemini)
--- http://www.pixelships.com
Cool you decided to continue your work on DESI-III - I used your program for geometry homeworks sometimes.
Note that get_mouse_mickeys() on most platforms returns values in pixel units, not actually mickeys.
Hi,
Thanks for your answers!
At least one user of DESI-III found , thanks Michael (Version 5.8, DOS, is nearly ready, includes a lot of new construction features : circles touching three entities (by ex.) and an interactive, context-sensitive and hyper-linked manual on screen etc.
Peter,
>> "Note that get_mouse_mickeys() on most platforms returns values in pixel units, not actually mickeys"
I assume that the "DirectX" connection on the Windows platform, means also "Direct Input" and the routine returns real mickeys in that case ?
Thanks,
Hugo
I assume that the "DirectX" connection on the Windows platform, means also "Direct Input" and the routine returns real mickeys in that case ?
DirectInput returns screen mickeys, not hardware steps. Allegro's mickey routines are the same, but return different values depending on whether the application is windowed or not.
Again, if all you need the hardware steps for is to do mouse sensitivity, just use set_mouse_speed(). Or another thing you might consider is to store the mouse coordinates as a floating point value and when the mouse moves you add or subtract by a decimal value based on your sensitivity settings. (For instance, with a sensitivity of 1.25f, a move of 20 screen pixels would become 25.0f.)
--- Kris Asick (Gemini)
--- http://www.pixelships.com
In my opinion, the number given by the OS has already applied an "acceleration" factor (as provided by the mouse driver), so the value is no longer linear with the "raw" mouse mickeys.
It's been a long time since I've checked such things, though - maybe acceleration is no longer used with recent mice.
Hi Kris,
This is an excerpt out of the MSDN library about DirectInput on the mouse:
Remember, GetDeviceState does not report the position of the cursor relative to either the screen or the window; it reports the travel of the mouse (in "mickeys," a mickey being the smallest movement of the mouse that can be recorded). In other words, if the cursor reaches the edge of the screen but the user keeps pushing the mouse in that direction, the axis values reported by GetDeviceState keep changing. If the user has mouse acceleration turned on, moving the Windows cursor a given distance may take more or fewer mickeys, depending on when acceleration kicks in. (By now you should have some idea of the acrobatics that would be necessary for tracking the Windows cursor position with GetDeviceState.)
Why I need this kind of information:
MS is moving the mouse on the screen and maps this screen movement to the "real world", on the other hand, I want to move the mouse in the "real world" and map its position to a pixel on the screen. The difference is that when you have a "big" drawing on the screen, let us say 800 x 600 cm and the screen resolution = 800 x 600, you map pixels to real world coordinates, the min. distance you can travel is
1 cm. You can't only detect movement from one pixel to another. On the other hand if you use mikey's you can define that each mikey will be corresponding by let us say 0.1 mm. Now you can indicate two different coordinates by moving the mouse, only 0.1mm apart but occupying the same pixel on the screen.
Regards,
Hugo
That's interesting, Hugo... because on my computer, one mickey from DirectInput = one screen pixel, and my mouse driver's speed is set to its middle setting.
--- Kris Asick (Gemini)
--- www.pixelships.com
Hi Kris,
Thank you for your kindness. Indeed the mouse calls are returning pixels, however that's the library itself that does the conversion from mikeys to pixels, I have checked the sources now. I am a happy man now , a few small changes and we are on the way with our port to Windows.
Many thanks to all the developers of Allegro.
Best regards,
Hugo