Find Jobs
Hire Freelancers

DirectInput: mouse input with time stamp,

$30-70 USD

已关闭
已发布超过 18 年前

$30-70 USD

货到付款
I need to save mouse co-ordinates when a user moves the mouse FAST inside a window (like a jerky movement). The coordinates will be saved into a notepad file with 'exact time' (millisecond precision) for each co-ordinate. A normal mouse has a sampling rate of less than 200 Hz. So, if a mouse moves for 1 sec, it sends about 200 coordinates to the system. I am expecting a notepad file in the following form: Time (s) X Y 0.000 156 86 0.005 156 89 0.010 157 90 … … … From the "Control Panel" of Windows, when the mouse hardware can support the maximum sampling rate up to 200Hz, we can change the sampling rate settings of the mouse to 80 Hz, 100 Hz and 200 Hz??" in each case we are expecting data (mouse co-ordinates X and Y) at the interval of 0.005 ms, 0.01 ms and 0.0125 ms respectively. Here is the crucial part: It is VERY easy to write a program in VB.Net or C++ .Net that collects mouse coordinates and the time for each coordinate. But, the time is NOT very accurate. And also because of the way mouse events and messages are queued and event handlers invoked, sometimes coordinates are lost and are not collected by a simple application. As the precision and accuracy of the time stamp are big concerns, I am suggesting using DirectX, specifically the "DIDEVICEOBJECTDATA Structure" of DirectInput because besides the mouse co-ordinates it also provides the time stamp of the co-ordinates. I need an application that will provide a window (of a particular size) where the user will be asked to move the mouse while holding the left mouse button down. As the user moves the mouse inside the window, the movement should be DRAWN on a window and the application will collect the mouse co-ordinates (with respect to the application Window) as well as an accurate time stamp for the co-ordinates using DirectInput (DirectX). Once the rapid movement is over, the application saves the collected data ??" (time with 5 ms interval, X co-ordinate and Y co-ordinate) in a “*.txt?? file. ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables): a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment. b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request. 3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement). 1) The code should be well-documented in English. Not in any other language. 2) I request you to send properly functional code (with no compilation and debugging error) and that can produce workable *.exe file. To make this project work, I recommend you to look at the following codes: There are two very good examples given with DirectX SDK installations. They are located at: Source: (SDK root) \Samples\C++\DirectInput\Mouse Source: (SDK root) \Samples\C++\DirectInput\Scrawl The first “Mouse?? example shows how we can use the mouse device using DirectInput. It clarifies the following things which are necessary for this project: Setting Up DirectInput The following two procedures have to be performed once only. The DirectInput object is then ready to manage all mouse and keyboard devices attached to the system. --Create the DirectInput object. --Enumerate the devices. Setting Up a Device --Create the device. --Set the cooperative level. Here, in our program it should be FOREGROUND, EXCLUSIVE AND BUFFERED. --Set the data format. Here, it should be mouse. --Set properties. This is the most crucial step of this project. Three things to be done in this stage: i) The buffer size should be set. ii) The mouse co-ordinates should be returned in absolute position of the window. “When the axis mode is set to absolute, the coordinates are a running total of all relative motions received by DirectInput. The axis coordinates are not initialized to any particular value when the device is acquired, so your application should treat absolute values as relative to an unknown origin. You can record the current absolute position whenever the device is acquired and save it as the virtual origin. This virtual origin can then be subtracted from subsequent absolute coordinates retrieved from the device to compute the relative distance that the mouse has moved from the point of acquisition.?? iii) If you use the ‘dwTimeStamp’ of the DIDEVICEOBJECTDATA structure to get the timing parameter. (You can also look at the sample “[login to view URL]? file to have a look at the way a different timer is used to poll the mouse. If you don’t want to use the ‘dwTimeStamp’, you can use the SetTimer??"the way it has been used there) “When Microsoft® DirectInput® input data is buffered (see Buffered and Immediate Data), each DIDEVICEOBJECTDATA structure contains not only information about the type of event and the device object associated with it. It also contains a time stamp and a sequence number. The ‘dwTimeStamp’ member contains the system time, in milliseconds, at which the event took place. This is equivalent to the value that would have been returned by the Microsoft Win32® GetTickCount function, but at a higher resolution.?? --Acquire the device. The second example ("[login to view URL]") shows how to draw lines smoothly on the windows using DirectInput with the mouse. It has also a better interface (which is a small window) and it can be closed (with the cross sign at the top right corner). ## Platform Code should be written in Visual C++ on Microsoft Visual Studio .NET (2002) platform to be run on Windows XP.
项目 ID: 3857887

关于此项目

7提案
远程项目
活跃19 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
7威客以平均价$50 USD来参与此工作竞价
用户头像
See private message.
$59.50 USD 在3天之内
5.0 (153条评论)
7.1
7.1
用户头像
See private message.
$59.50 USD 在3天之内
5.0 (108条评论)
6.7
6.7
用户头像
See private message.
$34 USD 在3天之内
3.6 (6条评论)
1.4
1.4
用户头像
See private message.
$50.15 USD 在3天之内
0.0 (0条评论)
0.0
0.0
用户头像
See private message.
$59.50 USD 在3天之内
0.0 (1条评论)
0.0
0.0
用户头像
See private message.
$42.50 USD 在3天之内
0.0 (2条评论)
0.0
0.0
用户头像
See private message.
$42.50 USD 在3天之内
0.0 (0条评论)
0.0
0.0

关于客户

CANADA的国旗
Canada
5.0
1
会员自8月 8, 2005起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。