mouse

GridLayout + Mouse Listener

ε祈祈猫儿з 提交于 2019-11-30 15:41:32
问题 Okay guys I have a problem, I dont know how know which cell was clicked on a grid layout, is there any function? I have grid layout on container, for 10 rows and 10 columns, and what I want is a mouse listener to all the cells, so when I click cell (2,1) it would say which cell I am clicking because of the mouse listener. Any clues? thanks alot in advance 回答1: Add a MouseListener to the Container that uses GridLayout and that holds the components in the grid. Then on mousePressed use the

Change mouse cursor over inactive NSWindow

独自空忆成欢 提交于 2019-11-30 15:40:38
I have subclassed NSWindow and I have a MYWindow class implementing the following method: -(void)resetCursorRects { NSImage *image = [NSImage imageNamed:@"cursor.png"]; [image setSize:NSMakeSize(32, 32)]; NSCursor *cursor = [[NSCursor alloc] initWithImage:image hotSpot:NSMakePoint(1, 1)]; [super resetCursorRects]; [self addCursorRect:[self bounds] cursor:cursor]; } This will change the cursor for the whole window and I will see cursor.png instead of the default mouse pointer. The problem is that this only works if the MYWindow is set to the key window which is of course non trivial to make it.

GridLayout + Mouse Listener

♀尐吖头ヾ 提交于 2019-11-30 15:35:45
Okay guys I have a problem, I dont know how know which cell was clicked on a grid layout, is there any function? I have grid layout on container, for 10 rows and 10 columns, and what I want is a mouse listener to all the cells, so when I click cell (2,1) it would say which cell I am clicking because of the mouse listener. Any clues? thanks alot in advance Add a MouseListener to the Container that uses GridLayout and that holds the components in the grid. Then on mousePressed use the MouseEvent object, say called myMouseEvent, to get the point of the click and call getComponentAt(myMouseEvent

High resolution and high framerate mouse coordinates on OSX? (Or other solution?)

流过昼夜 提交于 2019-11-30 15:13:43
问题 I'd like to get mouse movements in high resolution and high framerate on OSX. "High framerate" = 60 fps or higher (preferably > 120) "High resolution" = Subpixel values Problem I've got an opengl view running at about the monitor refresh rate, so it's ~60 fps. I use the mouse to look around, so I've hidden the mouse cursor and I'm relying on mouse delta values. The problem is the mouse events come in at much too low framerate, and values are snapped to integer (whole pixels). This causes a

Limiting mouse to one display on Mac (Potentially using Cocoa)

我是研究僧i 提交于 2019-11-30 14:57:26
I've been feverishly searching for a method by which to limit the user's mouse to one display in a multi-display setup on a Mac. I've stumbled upon this question: Cocoa: Limit mouse to screen , I promise I have not duplicated this question. The question did, however, spark an idea in my mind that it might be possible to write a simple application using Cocoa to restrict the mouse to one screen, run this application in the background, and still use my game which has been developed in AS3/Adobe AIR/Flash. The game is a full-screen game, and will always be at the same resolution on the same

High resolution and high framerate mouse coordinates on OSX? (Or other solution?)

自闭症网瘾萝莉.ら 提交于 2019-11-30 13:55:57
I'd like to get mouse movements in high resolution and high framerate on OSX. "High framerate" = 60 fps or higher (preferably > 120) "High resolution" = Subpixel values Problem I've got an opengl view running at about the monitor refresh rate, so it's ~60 fps. I use the mouse to look around, so I've hidden the mouse cursor and I'm relying on mouse delta values. The problem is the mouse events come in at much too low framerate, and values are snapped to integer (whole pixels). This causes a "choppy" viewing experience. Here's a visualization of mouse delta values over time: mouse delta X ^ xx 2

Moving mouse pointer on Android screen programmatically

不羁岁月 提交于 2019-11-30 13:52:13
I am developing an Android application where I would like to move the "mouse" pointer/cursor on an Android tablet. I know this is possible because when I connect a mouse (USB or BT) to an Android tablet (Honeycomb+), a cursor appears and I can interact with the tablet using the mouse only. I would like to control that mouse from Java on the Tablet. I already have a second device that can communicate the tablet and which can stream pointer coordinates to it. And no I can't use bluetooth. The second device that I'm using has WiFi but no ability to drive BlueTooth. My thought is that there must

How do I get the coordinates of the mouse when a control is clicked?

六月ゝ 毕业季﹏ 提交于 2019-11-30 12:57:22
In a TImage's OnClick event, I would like to extract the x,y coordinates of the mouse. I would prefer them in relation to the image, but in relation to the form or window is just as good. Mouse.CursorPos contains the TPoint, which in turn contains the X and Y position. This value is in global coordinates, so you can translate to your form by using the ScreenToClient routine which will translate screen coordinates to window coordinates. According to the Delphi help file, Windows.GetCursorPos can fail, Mouse.CursorPos wraps this to raise an EOsException if it fails. var pt : tPoint; begin pt :=

Device misdetected as serial mouse

♀尐吖头ヾ 提交于 2019-11-30 12:03:05
问题 I'm working on a device which communicates with a PC through a (virtual) serial port. The problem is that the data we are sending occasionally gets incorrectly identified by Windows as a bus mouse, after which the "Microsoft Serial Ballpoint" driver is loaded and the mouse pointer starts jumping around on the screen and randomly clicking on things. A bit of Googling reveals that is an old and well-known problem with serial devices where the usual work-around is a bit of registry hacking to

Global Mouse Hook + Simulate Mouse Inputs

安稳与你 提交于 2019-11-30 10:31:14
I'm looking to create a global mouse hook that works in XP/Vista/7 which would allow me to access the X,Y values that the mouse is inputting, and modify those values before they hit Windows... I also want to be able to simulate mouse inputs in between actual mouse inputs... For example, lets say our inputs looked like this: 1: 1,0 2: 2,0 3: 3,0 4: ?,? I want to be able to intercept input number 4 and run it through an 'if' statement: If the value of the input matches certain parameters, I want to modify the value by adding or subtracting from it... A USB Mouse has a default polling rate of