mouse

JavaScript Mouse position over an element (code not working)

Hello, I want to display the mouse position when its inside an element.. heres the code: Mouse Events Example function GetMousePositionInElement(ev, element) { var osx = element.offsetX; var osy = element.offsetY; var bottom = osy + element.height(); var x...

Hands-free mice for programmers?

The standard setup for programmers really requires three hands: two for the keyboard, and one for the mouse. I'm not blessed with an extra hand, so my hands have to shift from mouse to keyboard to mouse. But plenty of hands-free mice exist: either by moving your head, by speaking, or by using feet. I'm not particularly handicapped, ...

Click and drag selection box in WPF

Is it possible to implement mouse click and drag selection box in WPF. Should it be done through simply drawing a rectangle, calculating coordinates of its points and evaluating position of other objects inside this box? Or are there some other ways? Could you give a bit of sample code or a link? ...

get mouse deltas under linux (xorg)

Is there a convenient way to get mouse deltas (e.g. mickeys) under X/linux? I know that I could read from /dev/input/mice but that requires root access and seems a bit to low level for me. Any idea? ...

How do you get the location, in x-y coordinate pixels, of a mouse click?

In C++ (WIN32), how can I get the (X,y) coordinate of a mouse click on the screen? ...

Pragmatic way of handling mouse in Core Animation layers

Hello, I'm starting working with Core Animation and I started wondering how to handle various kinds of mouse events like mouse entered a CALayer mouse exited a CALayer mouse click on a CALayer For now I'm concentrating just on mouseDown message sent to my custom view. According to the documentation I should use -hitTest:(CGPoint)poin...

Mapping mouse events in vim through putty not working...

I'm using Vim 6.3.81 on a x-term through putty. I wanted to map mouse events (like wheel-button click , double click) to specific events using my .vimrc . I've looked at the vim wiki and based on it, defined the following map in my .vimrc: :nnoremap <2-LeftMouse> :set invnumber<CR> However , it is not working - double-click is not tog...

Scroll up/down while selecting multi-page block of text in Vim through putty

I'm using vim 6.3.81 on a xterm through putty. When I use set mouse=a , I can scroll through the file , but not select text. When mouse is disabled using set mouse=, I can select text with mouse (automatically copied to a buffer) , but if the text block is over one page long , I can't scroll up/down (and have to select text one screen at...

Java Swing: change background color on mouse over

Hi, I've implemented a simple mouse listener where the background color changes whenever the mouse enters the component (a JPanel), and it reverts back whenever the mouse leaves. This has some problems: Sometimes the mouse moves so quick that the mouseExit event is not fired If my component has childs, when the mouse moves to the chil...

Get size of mouse cursor in javascript

Hi, I need to determine the width and height of the current mouse cursor used on our webpage. I need to show a div right under the cursor, and possibly to the right of it. So I need to determine the offsets of my div from the exact pointer location, so the cursor do not cover up the div. The mechanism will be used in intranet system...

Help with object from mouse algorithm

I wasn't sure what to call this. I'm building a tile based game where the user can click on a tile. it is a 2d c++ vector of tiles. right now I have an algorithm that positions them like this: [][][][][][][][][][][] [][][][][][][][][][][] [][][][][][][][][][][] [][][][][][][][][][][] [][][][][][][][][][][] [][][][][][][][][][][] they ...

Getting text from the screen at a specific coordinate

Hi all I have created a mouse event handler that gives me the screen coordinate (X,Y) on a right click of the mouse. I did that because I want to get the text ( a letter) that is located at that position. I know how to get the XY position on the screen but I can't figure out how to get the text or object at that position. Need some h...

Set Statusbar Text on Mouse Hover - Works for controls but not MenuItems

I devised the following code for displaying a control's Tag property on mouseover. The code works fine for standard controls such as Labels and TextBoxes but I cannot get it to work for my MenuItems (more specifically ToolStripMenuItems). Could y'all please take a look at my code and tell me what I did wrong? Thanks in advance! public v...

Box2d: mousejoint without inertial delay

I'm using mousejoint to drag bodies in box2d, but it causes inertial delay. Does it exist any way to drag a body instantaneously? ...

Getting MouseMoveEvents in Qt

In my program, I'd like to have mouseMoveEvent(QMouseEvent* event) called whenever the mouse moves (even when it's over another window). Right now, in my mainwindow.cpp file, I have: void MainWindow::mouseMoveEvent(QMouseEvent* event) { qDebug() << QString::number(event->pos().x()); qDebug() << QString::number(event->pos().y())...

jquery hover() mouseOut event not firing when mouse is moved quickly over link

Hi guys need your help on hover mouse out event not firing Problem i basically have simple link list and when you hover over it it appends a div (loading data in this div from xml) and on hover out it removes the div, but it only happens when mouse moves slowly over the links as soon as mouse moves more fast then usual over the links ...

Simulate mouse click/Detect color under cursor in Python

Hi, I am very new to python. I am trying to write a program that will click the mouse at (x, y), move it to (a, b), and then wait until the color under the mouse is a certain color, lets say #fff. When it is that color, it clicks again and then repeats. I cannot find a good API for mouse related stuff for python. ...

Rotating an image with the mouse

I am writing a drawing program, Whyteboard -- http://code.google.com/p/whyteboard/ I have implemented image rotating functionality, except that its behaviour is a little odd. I can't figure out the proper logic to make rotating the image in relation to the mouse position My code is something similar to this: (these are called from a m...

wpf: capturing mouse does not work

hello I am developing an kind of outlook calendar application where I need to make the appointment resizable from mouse. My first try with a thumb did not work properly so I tried another way. What I did is that: 1) on the botton of the appointmennt panel I added a rectangle to figure out the resize zone (the thumb). The appointment p...

Mimicking/faking a Mouse Click and Mouse Wheel using Qt

How to mimic/fake a Mouse Click and Mouse Wheel using Qt? To be more specific, I want to click inside and outside the Qt application. Thanks in advance! ...