mouse

How can I attach a mouse event to a Run object in Silverlight?

I can attach a mouse-click event to a TextBlock object like this: TextBlock tb = new TextBlock(); tb.Text = "click here"; tb.MouseLeftButtonDown += new MouseButtonEventHandler(tb_MouseLeftButtonDown); But I would like to instead attach the mouse-click to individual Run objects inside the TextBlock object so that various parts of the T...

How to draw a rectangle in C# using a mouse

Hi, I want to draw a rectangle on a form in C#. I read and found this article. Are there any samples or tutorials available ? The article was not very helpful. ...

Mouse Up WM_LBUTTONUP event not firing

I'm using .net 2.0 compact framework compiling for pocket PDAs. I need to determine how long the mouse (stylus) has been held down for. To do this I capture the WM_LBUTTONDOWN and WM_LBUTTONUP messages and record the time that i received them. Then simply put WM_LBUTTONUP time - WM_LBUTTONDOWN time should be about how long it was held do...

Mouse pointer state in Windows applications doesn't change until mouse moves

Did anyone notice that in Windows applications the mouse pointer doesn't change from Hourglass back to normal until you move the mouse? So even if your application has finished a task and the mouse pointer has been set to go back to default, it will stay as an hourglass until you move the mouse. What is the reason for this, and can be ...

Fade in on mouse movement (like on google.com)

How do I fade in div content on first mouse movement, like on google.com, using javascript? I don't want it to fade out again. ...

Mouse DirectInput for OSX

Does anybody know of some code I can look at that tracks mouse input on a Mac like DirectInput does in Windows? I'm trying to implement "freeview" on a Mac. I've read that the HID Manager is the way to go, but I'm not sure where to start on it ... ...

Cocoa - How to get Mouse Down Events when mouse isn't Dragging?

Hi all, Cocoa, Mac OS X 10.6. My app (a game) needs to determine if the mouse is down within a view, repeatedly, even if the mouse position doesn't change. The problem: mouseDown will only be called the first time the mouse is pressed and held down. If the mouse is not moved at this point, mouseDragged is not called, and no more mou...

Relative mouse movement in HTML5.

I'm (still) porting an old Macintosh game to HTML5 and JavaScript. The game is a Tempest clone. (Wikipedia article on Tempest) (Shameless pimp of my project) While it's certainly possible to implement controls using the keyboard, I'm also wondering if it's possible to make relative mouse movement work in HTML5. The typical ways that I'...

Apple like mouse hover-zoom cursor

Hi, Apple has a pretty cool feature when hovering over a large image here: http://www.apple.com/aperture/what-is.html It zooms out a small magnifier glass icon which moves with the cursor while over a zoomable image. How can I do that, preferably with JQuery? Can anyone help me please? THX ...

Detect Mouse Button for FireFox in Javascript

What is the best way to go about detecting what button has been pressed in a DIV in FireFox using javascript? ...

What should i do make this code work in VS 2010?

I have used this code manually to simulate a mouse click by system through code. using System; using System.Windows.Forms; using System.Runtime.InteropServices; public class Form1 : Form { [DllImport("user32.dll",CharSet=CharSet.Auto, CallingConvention=CallingConvention.StdCall)] public static extern void mouse_event(long dwFlags...

Detect both left and right mouse click at the same time?

I'm remaking windows Minesweeper (from XP) and something they had included was that if you click a number with as many flags as it's number with the left and right mouse button at the same time, it reveals every other hidden tile around that number. I'm having a hard time telling when both the Left and Right mouse buttons are pressed at...

How to draw a highlight around mouse cursor

I'd like to be able to display a quick animated "flash" around the mouse cursor (similar to the effect in some screen-recording applications). What would be a good way to go about this? My current idea is to display a temporary, floating, transparent window window under the mouse position, animate it, then hide it. But I'm wondering if ...

Silverlight mouse button up outside control

Hello, I have a made a simple UserControl that allows a user to drag a button around and drop it. It uses MouseLeftButtonDown and MouseLeftButtonUp to start and stop dragging. The problem is, however, that MouseLeftButtonUp is only triggered when the mouse is actualy on my UserControl. How can I catch 'global' mouse events on this Use...

Why use bitwise operators for checking mouse clicks?

I usually write the following to handle a right mouse click. if (e.Button == MouseButtons.Right) { } But, I have seen people do it this way. Can somebody tell me why they do it this way? What's the advantage? if ((e.Button & MouseButtons.Right) == MouseButtons.Right) { } ...

Low level mouse hook and DirectX

I'm building an application which needs to filter some mouse clicks system-wide. That is, I need to make the system ignore some mouse button clicks at special occasions. I use low level mouse hook and SetWindowsHookEx to filter out these clicks. It works relatively well, except for WPF applications. I guess that's because these applicat...

any chart / graph / plotting c c++ library which is similar as bloomberg chart, with mouse interaction on plotted line, and multilayer plot

any chart / graph / plotting c c++ library which is similar as bloomberg chart, with mouse interaction on plotted line, and multilayer plot? gnuplot is very powerful but it seems to me it can feed in data but no callback to mouse action and no manipulation on plotted line / chart, e.g. over mouse over particular line and I would dump th...

How to move the mouse in Windows Scripting VBScript (cscript)

Hi, In the Windows scripting API is there any way to move the mouse through similar to the wshell.SendKey() function? Thanks in advance ...

Qt How to disable mouse scrolling of QComboBox?

I have some embedded QComboBox in a QTableView. To make them show by default I made those indexes "persistent editor". But now every time I do a mouse scroll on top them they break my current table selection. So basically how can I disable mouse scrolling of QComboBox? ...

Loss of Silverlight mouse up events after mouse capture?

I created a very simple test control that has a Rectangle on a canvas (within other containers, but inconsequential). The Rectangle has event handlers for mouse down, mouse move, and mouse up. If I capture the mouse in the Rectangle's MouseLeftButtonDown event, I do not receive a corresponding MouseLeftButtonUp event. Some code: priv...