All they can report is how much they have moved since they were last polled. They have no ability to tell where they are. Mice in general are a relative pointing devices. (See the wikipedia note about mouse speed for more information.)įrom the sound of your post, it sounds a bit like you are thinking a mouse is an absolute pointing device. However, provided your device's screen is not physically very large and/or high-resolution, it's very possible you can simply leave out pointer acceleration without making it much harder to use. There are (considerable) additional complexities involved in handling mouse-movement on a modern computer, as (almost all) current operating systems have an additional characteristic called pointer acceleration. You of course have to do some sanity-checking to ensure your pointer does not leave the screen, but that is the basics required for a implementation of a mouse-pointing-device. With a computer screen, basically every display-update-cycle, the computer sums the total reported mouse movement in X and Y, and moves the pointer that much relative to it's current position. The values returned by the mouse are the amount of movement since it last reported.Īs such, if you want to make a system that performs like a typical computer mouse, you need to integrate the delta values reported by the HID driver. It's my understanding that a mouse is fundamentally a relative device. For consistency, I generally set my physical to match my logical. In the grand scheme of things, physical min/max aren't that meaningful unless you intentionally use them. can be found at the given location, the topmost label will be looked for. Software can then read the HID descriptor to determine the mapping. a mouse click is performed at a location where no clickable item can be found. In this case, when the device sends a 0, it means 32 F, and when it sends 999, it means 212 F. In this case, from water's freezing (32 degrees F) to the boiling (212 F). The Physical Min/Max describes how the Logical units map onto a Physical "spectrum". These values are determined by the Logical Min/Max. That's the bytes that actually flow from device to PC through an IN endpoint. So for this example, the HID thermometer would be returning a value between 0-999 in the report. For example, a thermometer might have logical extents of 0 andĩ99 but physical extents of 32 and 212 degrees.The resolution can be Meaning to those bounds by allowing the report value to be offset and Returned by a device, Physical Minimum and Physical Maximum give While Logical Minimum and Logical Maximum (extents) bound the values If I recall correctly, the Physical Min and Max are just "window dressing" so to speak. But where to get the unit and unit exponent(for finding the resolution and how much the mouse has moved)? Thanks again I understand it is relatve(from 81 06).And in addition to it, I get coordinates(X and Y) and buttons whenever I move or click. This is what I am getting as hid descriptor from my logitech mouse. The Physical Min/Max describes how the Logical units map onto a Physical 'spectrum'. As the user move or click the cursor with the mouse over the grid, a label displays the location of cursor, i.e., shows coordinates with respect to x-axis. I dont know what are the values after the input field. So for this example, the HID thermometer would be returning a value between 0-999 in the report. Because the HID descriptor I am getting consists of the following fields: Usage Page- 05 01 But from which field of the descriptor I can find the unit, means whenever I move a mouse I will get the X and Y, how to find out what is the unit it has moved?(inch or meter). Is it because the values returned by the mouse are continuous and I have to implement some averaging? Or is it like the mouse coordinates returned are relative and I have to initialize my mouse coordinates as (0,0) and from the previous position I have to calculate the current position? A mouse event type is enabled by adding the appropriate mouse-based EventListener to the component ( MouseListener or MouseMotionListener ), or by invoking Component.enableEvents (long) with the appropriate mask parameter ( AWTEvent.MOUSEEVENTMASK or AWTEvent.MOUSEMOTIONEVENTMASK ). If I want to calibrate my mouse to a given display, where to give the coordinates? Also, when the mouse action takes place, I am getting coordinate values (X and Y and buttons) two or three times.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |