473,472 Members | 2,181 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Press two mouse buttons at the same time

2 New Member
I want to detect when MouseButtons.Right MouseButton.Middle are pusheds at the same time.

I have this
Expand|Select|Wrap|Line Numbers
  1.  
  2. private void SceneView_MouseMove(object sender, MouseEventArgs e)
  3. {
  4. vMouseOld.x = vMouse.x;
  5. vMouseOld.y = vMouse.y;
  6. vMouse.x = e.X;
  7. vMouse.y = e.Y - toolStrip1.Size.Height;
  8.  switch (e.Button) 
  9.             {
  10.                 case  MouseButtons.Right:   camera.yaw((vMouse.x - vMouseOld.x) * 0.01f);      
  11.                                    camera.pitch((vMouse.y - vMouseOld.y) * 0.01f);
  12.  
  13.                         break;
  14.                 case MouseButtons.Middle:   camera.strafe((vMouse.x - vMouseOld.x) * 0.01f);
  15.                                             camera.up((vMouse.y - vMouseOld.y) * 0.01f);
  16.                                                                                  break;
  17.  default: break;
  18.  
  19.             }
  20. }
  21.         {
And I want to add another case when both buttons are pressed.

Thank you.
Jun 24 '11 #1
1 2189
Marian
2 New Member
I get it.

I added a new case.
Expand|Select|Wrap|Line Numbers
  1. case MouseButtons.Right | MouseButtons.Middle:
Sorry was so easy.
Thank you.
Jun 24 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Deacon Sweeney | last post by:
Hi. I've embedded some buttons in a Text object, and I would like these buttons to perform a 'tear-off' of that line when clicked. That is, when the button is clicked, I would like a new Toplevel...
1
by: TD | last post by:
hi am trying to program a scheduler actually i used the DrawGrid component and am trying to click on a cell in it to color it i used the onmouseclick event but the problem is that things work...
3
by: Emjay | last post by:
Newbie needs to know how to set the mouse position.
4
by: Raj Chudasama | last post by:
I have a controls similiar to the windows calculator. (Please press some buttons on your calculator to see what i am talking about) So when u hover over a button it will change the state (it...
1
by: darrellm58 | last post by:
THis code is straight out of a text book but the color is always black. It is suppossed to draw black with one mouse button and red with the other. Can anyone spot a problem? Thanks. ************...
1
by: Boni | last post by:
Dear all, Is it possible using pinvoke to disable a mouse events for a particular window? Window handle is available. Thanks a lot, Boni
2
by: Denis | last post by:
In a form, how do I disable the mouse wheel button from scrolling through records? I have disabled the navigation buttons at the button of the form and don't want a user to be able scroll through...
4
by: Vincent | last post by:
I have created a drag and drop scheduler within Microsoft access. One of our bug testers was doing some testing and noticed that the drag and drop gets messed up if they press both the left and...
0
by: =?Utf-8?B?SmVmZiBHb3Jkb24=?= | last post by:
I bought this mouse because it is certified to work with Windows Vista and it has (per box) 5 programmable buttons. Can anyone please help with programming the buttons Thank you in advance
18
by: Shocky | last post by:
Hi there, I am trying to detect whether my IE6 users have pressed both right and left mouse buttons simultaneously in my Javascript code, by using: if(event.button==3) {alert("Both right and...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
1
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...
0
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...
1
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
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.