mouse

WPF: Is ListBox or Panel responsible for mouse wheel navigation?

I have a custom ListBox which uses a custom Panel as ItemsHost. I want to have control over mouse wheel input, so that turning the wheel changes the single selected item. I believe that the best method to do so is to handle the OnPreviewMouseWheel event (although this is only have what I want since it doesn't provide horizontal wheel da...

Swapping left and right mouse button in .NET

How do I swap left and right mouse buttons in .NET (preferably C#)? Basically the result should be the same as if the user checked the "Switch primary and secondary buttons" checkbox in the Mouse Properties through the control panel. I'm dealing with Windows XP, in case that makes a difference. ...

moving mouse cursor off screen in C#

Hello Everyone, I have a wpf window that has a height of 2000 with an actual desktop height of about 1000. Obviously about half of the window is off screen. Even though the window extends below the screen, the mouse will not move down to that area. I do want this content to be off-screen, and I want the mouse to be able to move over ...

PreviewLeftMouseButtonDown Listeners Report Different MouseButtonEventArgs.Source For Same Event

I'm getting some unexpected behavior in WPF. Here's my scenario: I have a UserControl on a Window. Let's call it "Surface". It has a Canvas on it. I have a second UserControl. Let's call it "PlayingCard". I have the PlayingCard UserControl added as a Child of the Surface's Canvas. Visually it displays just as it should, on top of th...

How do you hide the mouse pointer under Linux/X11?

How do I hide the mouse pointer under X11? I would like to use the built in libraries in order to do this and not something like SDL (SDL_ShowCursor(0)) or glut (glutSetCursor(GLUT_CURSOR_NONE)). Also, the mouse pointer should be hidden no matter the pointer location, not just in its own window. ...

How does one use onmousedown/onmouseup correctly?

Whenever I write mouse handling code, the onmousedown/onmouseup/onmousemove model always seemed to force me to produce unnecessarily complex code that would still end up causing all sorts of UI bugs. The main problem which I see even in major pieces of software these days is the "ghost mouse" event where you drag to outside the window ...

Framerate uneven on mouse input in 3D app

I'm writing a 3D application for Windows, using OpenGL. For now it renders a simple test scene with one model of about 50000 polygons and it renders smoothly at 60FPS. However, the framerate gets very uneven whenever the mouse is moved over the application window. It fluctuates from 400 FPS to 20 FPS randomly. Is there any reason for th...

Creating mouse cursor/pointers in OS X Leopard

I have a small gif that I can use as a mouse pointer with a browser by doing something like: .myclass { cursor: url("mycursor.gif"); } This works OK except that the hotspot is in the wrong place. Anyone know of any OSX Leopard software I can use to set the hotspot? I might be able to do it with Rezilla but I don't know ...

Drag/Size Handle implementation

I'm looking for drag/size handle implementations or explanations. Perhaps I'm using the wrong nomenclature, but I mean the "handles" that appear around an object (mostly in drawing programs) when you select it and want to perform an operation on that object such as rotate, size, scale, etc... Can anyone point me to an OSS implementatio...

Store mousedown locations

My cocoa app calculates the location for every mousedown event. The next time the mouse is clicked, the location is overwritten by the new one. How can I store the locations? Is it possible to create an array with mousedown locations? Thanks ...

Making an array of NSRect values in mousedown method

My cocoa app calculates the location of every mousedown event. It also checks whether the location is located inside a rectangle using NSPointInRect and while enumerating over an existing mutable array with values of the rectangles. I'm using an if-statement to add the rectangle values in which the mousedown event is located to a new arr...

Simulate mouse click to window instead of screen

Is it possible in MacOS X to send a mouse click to a specific window? I already managed to send a click to the entire screen via CGPostMouseEvent. The windows i want to control overlap each other, so my next idea was to bring the proper window to the front before triggering the click. It works but ends in a total mess... ;-) ...

glutPassiveMotionFunc and glutWarpMousePointer

I want to implement my own cursor in an OpenGL / GLUT window. The usual way to do this is to freeze the cursor (so it can't hit the edges of the screen) and keep track of its position yourself. I can make the onscreen cursor invisible using glutSetCursor(GLUT_CURSOR_NONE); and then inside of my glutPassiveMotionFunc callback move the...

Fill-in color on triangle using mouse click

I was wondering how to fill in a triangle shape with color when a user click on the triangle. So far I am using txt file as input file to read the coordinate of the triangle to be drawn on screen. ...

How to send relative mouse movement to another pc

I catch the windows mouse movement events and calculate an relative mouse movement to send it to another pc. So far so good, works well. But if I block the mouse movement on the screen that is sending the mouse coordinates (the client) or reach one side of the screen, there is a second mouse event fired by the windows api, that snaps th...

ListItem Mouse Enter Message Box

Hi, I am using event triggers in my XAML, I have the following style set on a ListItem. What I want is to display the contents of the ListItem in a message box when the mouse enters a list item. <Style.Triggers> <EventTrigger RoutedEvent="Mouse.MouseEnter"> </EventTrigger> </Style.Triggers> I ...

Mouse trigger not properly happening if html created through JQuery

Hi there, for this code: <div id="header">top of page</div> <div class="message">hello, how are you</div> <div class="message">I am fine</div> $(document).ready(function() { $("#header").append('<div class="message">appended DIV</div>'); $('div.message').hover( function() { alert('hi'); }, function() { alert('bye...

Locking focus and capture to a specific window

I can call a setfocus and setcapture using a toggle mechanism and in OnLButtonDown make sure the message doesn't get passed on, but that seems to fail the moment you left click. Is there any way to ensure that the window which has capture and focus does not give it up? ...

Mac OS X: CGGetLastMouseDelta and moving the mouse programatically

I'm developing an extension to MATLAB's PsychToolbox that allows for better control of the mouse during psychophysical experiments (specifically, preventing the screen boundaries from limiting drag operations... it should feel like you can move the mouse "infinitely" in all directions). Since MATLAB doesn't support the creation of addit...

c# wpf overlapping controls not receiving mouse events

Hi, I am building a canvas control. This root canvas has several overlapping children (canvas as well). This is done so each child can handle its own drawing and I can then compose the final result with any combination of children to get the desired behavior. This is working very well as far as rendering is concerned. This does not work...