473,665 Members | 2,820 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help please.. anyone used RawMouse / RawInputMouse?

Hello all.

Quick question for anyone that has used RawMouse / RawInputMouse (and for
anyone that hasn't used it.. look here:
http://link.mywwwserver.com/~jstookey/arcade/rawmouse/).

RawMouse is basically a program for managing multiple mouses independently
but connected to the same machine using MAME.

It's been ported to C# recently enough and having finally gotten it to read
two mouse inputs from the one PC.... am now able to use my TouchPad and my
USB Mouse to control two paddles on m Air Hockey game.

But if both paddles move at the same time, the delay can be quite
problematic!

Below is the important snippets of my code for implementing it...

using RawInputSharp;

namespace AirHockey
{
public class frmTable : System.Windows. Forms.Form
{
// rawmouseinput
private RawMouseInput _rmInput;

public frmTable()
{
InitializeCompo nent();

//create and init
_rmInput = new RawMouseInput() ;
_rmInput.Regist erForWM_INPUT(t his.Handle);
UpdateControls( );

DoubleBuffering ();
CreateTablePath ();
CreatePlayer1Re gionPath();
CreatePlayer2Re gionPath();
}

protected const int WM_INPUT = 0x00FF;

protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case WM_INPUT:
//read in new mouse values.
_rmInput.Update RawMouse(m.LPar am);

UpdateControls( );
break;
}
base.WndProc(re f m);
}

protected void UpdateControls( )
{
if(_rmInput.Mic e.Count > 0)
{
RawMouse mouse1 = (RawMouse)_rmIn put.Mice[0];
paddle1_x = mouse1.X;
paddle1_y = mouse1.Y;
}

if(_rmInput.Mic e.Count > 1)
{
RawMouse mouse2 = (RawMouse)_rmIn put.Mice[1];
paddle2_x = mouse2.X;
paddle2_y = mouse2.Y;
}
}
}

Is there any way to improve the efficiency of this? Even decrease the delay
somewhat!

Thanks in advance all.

Brian
Nov 16 '05 #1
0 2491

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3473
by: Steve | last post by:
Hi everyone, I'm trying to make an openGL app (in visual c++) that allows the use of two mice simultaneously. Does anyone know if this is possible, how I might go about doing it or how I could find out how to do it? Much thanks in advance, Steve
12
2117
by: Christo | last post by:
borland c++ 5.01 character constant must be one or two characters long get this when compiling my first c++ program can anyone out there help? it is highlighting this line as the problem cout << "Please Enter First number: ";
4
1634
by: Weasel | last post by:
Hey everyone, My names John and i just recently joined this googl group, and I joined because i need some help. I'm currently a Sophomore in High school and i'm really interested in computer programming well i have been for about 8 years... My brother graduated last year from UCR majoring Computer science and he now works for a buisness programming... well anyways i want to start programming, my brother gave me a c++ book he used but i...
8
19589
by: Andrew McNab | last post by:
Hi folks, I have a problem with an MS Access SQL query which is being used in an Access Report, and am wondering if anyone can help. Basically, my query (shown below) gets some records from a couple of tables in my database using INNER JOINS and the WHERE clause to specify the required constraints. However, I also want to read two fields from a *single* record from a table called 'Locations' and then apply one of these field's values...
5
2311
by: SStory | last post by:
Hi all, I really needed to get the icons associated with each file that I want to show in a listview. I used the follow modified code sniplets found on the internet. I have left in commented code for anyone else who may be looking to do the same.
17
3539
by: Timothy.Rybak | last post by:
Hello all, This is my first attempt at an application, so kid gloves are appreciated. I need to make a very simple form that only has a few elements. One is TraceCode - a text field that is populated when a user scans a label. The other is ScanDate - a date/time field that should equal the date/time of the scan (e.g. 7/31/2006 5:00:00 AM).
3
1632
by: standon410 | last post by:
Hi, I'm trying to develop a questionnaire...basically a user can pick one of 5 questionnaires they want to use, and based on their choice, those questions will appear in their form. So the database table contains all the questions/radiobutton selections in one table (well, a view), and they are related to their respective questionnaires based on a form ID. Now, How do I populate a RadiobuttonList, AND label above the
1
1328
by: Tara | last post by:
intro about Asp ..help -------------------------------------------------------------------------------- HI All , i am not into development ...i am into testing actually ... So just for interest , i have gone through VB.NET and kind of comfortable with it Now i want to start with Asp.net ..so refered this site to download asp.net http://www.asp.net/downloads/essential.aspx?tabid=62 it says there
0
5558
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
0
8863
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8779
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7376
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6187
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5660
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2004
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.