mouse

OSX assign left mouse click to a keyboard key

二次信任 提交于 2019-12-12 08:58:16
问题 I would like to be able to assign a key on my keyboard to be equivalent to a left mouse click. Ideally it needs to act such that holding the key down is also equivalent to holding the left mouse button down. I'd like this capability as a user, additionally a programmatic solution (cocoa/applescript etc) would be great too. 回答1: Not exactly what you want, but in the System preferences -> Universal access you can turn on mouse keys - and with them you can move (and click) mouse by keyboard.

Simulate a physical mouse move in Mac OS X

ぃ、小莉子 提交于 2019-12-12 07:52:12
问题 I'm looking for a way to simulate a mouse move event in Mac OS X 10.6. It would have to be defined in mouse units (rather than pixels — that is important!) I need this for an experiment which basically consists of drawing lines. Any ideas are welcome. Thank you! 回答1: One of the easiest ways to move the mouse in Mac OS X and other operating systems is to use a Java Robot. It can also simulate other events. For example, the mouse down or even a key press. However, it moves the pointer to a

Deleting drawn rectangle zoom box after zooming in

你离开我真会死。 提交于 2019-12-12 05:27:28
问题 I'm trying to code a draggable rectangle zoombox that's transparent, once the mouse is up again, it zooms into that area and deletes the drawn rectangle. I've got the zoom working and drawing the rectangle, however I can't 1) Figure out how to make it transparent , and 2) Figure out how to delete the rectangle after it's zoomed in . It gets deleted again once the mouse is clicked down to draw another zoombox on the zoomed in image (I'm drawing a fractal) but I can't figure out what to write

detect click on shape pygame

╄→尐↘猪︶ㄣ 提交于 2019-12-12 04:44:00
问题 so I have tried detecting the collision by making 2 shapes but there is some kind of mistake in it and I am wondering if there are easier ways. so this is what i tried: cursorSurface = pygame.Surface((0,0)) cursor = pygame.draw.rect(cursorSurface, (0,0,0),(mouseX,mouseY,2,2)) mouse_mask = pygame.mask.from_surface(cursorSurface,255) mouse_rect = cursor if mouseAction[0] == 'move': if mouseX > x and mouseX < xEnd and mouseY > y and mouseY < yEnd: topTriangle = selectedSquare.subsurface(x+4,y+4

Cocoa - capture mouse just like screencapture utility

非 Y 不嫁゛ 提交于 2019-12-12 04:18:50
问题 I am trying to find the answer to a topic which has basically driven me insane. Is there a way to capture the mouse pointer much like Apple's screencapture utility works? What I am trying to do requires me to draw a clear window that does not activate my app but instead overlays everything, including the dock. The only software I have seen do this is screencapture by utilizing command+shift+4. I have tried creating a non-activating NSPanel but it doesn't work with cursor rects unless my app

Javascript mouse coordinates without event [duplicate]

瘦欲@ 提交于 2019-12-12 04:04:21
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to get the mouse position without events (without moving the mouse)? Is it possible to get the mouse current coordinates without any kind of event? Only Javascript! No jQuery... 回答1: No, such thing is impossible with javascript only and without events. 回答2: It is not possible, neither with plain javascript, nor with jQuery's help. You need at least a mousemove event. 来源: https://stackoverflow.com/questions

what is the difference between onClick and mouseClick?

我只是一个虾纸丫 提交于 2019-12-12 04:00:06
问题 wondering what is the major difference between these two: onClick and mouseClick.. 回答1: Assuming that you're talking about Java, the difference is right there in the documentation for MouseEvent: Mouse Events * a mouse button is pressed * a mouse button is released * a mouse button is clicked (pressed and released) * the mouse cursor enters the unobscured part of component's geometry * the mouse cursor exits the unobscured part of component's geometry If you're talking about JavaScript, I'm

Flash AS3 | Pan / Zoom with mouse input

陌路散爱 提交于 2019-12-12 03:24:47
问题 I was looking to see if someone can help me figure out how to create a panning effect over an already playing video in Flash AS3, where the camera is directed by where the mouse is. For example, this game here http://www.kongregate.com/games/jorjeade/seven-deadly-sins (skip the intro to get to it quickly) has an over world map which pans around by using the mouse. I'm trying to achieve a similar effect for my flash video. Any help coding this would be awesome! I'm also looking to see if I can

JQuery mousdown with setInterval endless

随声附和 提交于 2019-12-12 03:24:16
问题 My question is referring onto this question. At the moment I am using this answer, but I still can trick that code, so the clearInterval won't stop. While holding my left mouse button I simple press the right one to open the contextmenu. Now the clearInterval wasn't called. If I add the contextmenu event to the clicker , with a clearInterval it does get called, but it won't clear the interval. See this demo 回答1: Add clearInterval() to the mousedown event: clicker.mousedown(function() {

convert window coordinates to 3D world coordinates with glut function glutMouseFunc()

时光怂恿深爱的人放手 提交于 2019-12-12 03:17:12
问题 I am trying to get the 3D coordinates of a mouse click C++/OpengGL with the glut function glutMouseFunc(). So I created a function like this: void mouse(int button, int state, int x, int y){ if(button == GLUT_LEFT_BUTTON && state == GLUT_DOWN) { mouse_x=x; mouse_y=y; } } The function gets the window coordinates of the click of the mouse and i use it with the glut function glutMouseFunc() like this: glutMouseFunc(mouse); My question is how would I modify the coordinates given by the mouse