mouse

Changing value of boolean when mouse cursor hovers over a JButton

孤街浪徒 提交于 2019-12-04 05:33:56
问题 I have a button that will change from black to gray when you hover over, I do this with setRolloverIcon(ImageIcon); . Is there any easy way to make a boolean equals to true while the mouse cursor hovers over the JButton or would I have to use a MouseMotionListener to check the position of the mouse cursor? 回答1: Is there any easy way to make a boolean equals to true while the mouse cursor hovers over the JButton you can to add ChangeListener to ButtonModel , e.g. JButton.getModel()

Apple Events to Control Mouse Remotely

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 05:28:21
I'm not even sure where to begin with this question... I want to be able to send mouse-click events to another machine, as if the user had clicked on that machine. I can do it on the same machine via: CGEventSourceRef source = CGEventSourceCreate(NULL); CGEventType eventType = kCGEventLeftMouseDragged; CGPoint mouseCursorPosition; mouseCursorPosition.x = point.x; mouseCursorPosition.y = point.y; CGMouseButton mouseButton = kCGMouseButtonLeft; CGEventRef mouseEvent = CGEventCreateMouseEvent ( source, eventType, mouseCursorPosition, mouseButton ); CGEventSetType(mouseEvent,

Detect right click's “open in new tab” on link in jQuery?

江枫思渺然 提交于 2019-12-04 04:25:38
问题 I want my links to look like legit urls, but behave differently, like go to some tracking url I define, when a click event happens. When i click link with left mouse button, i can catch it with .click() handler and change the href to something else. When i right click, it won't be caught with .click(), but i can use .mousedown() and .mouseup(), which is only a partial solution to my problem. The thing is, i want to make sure that when some user right clicks the link, the link would still look

smoothing mouse movement

眉间皱痕 提交于 2019-12-04 03:31:59
问题 I'm developing a software to move the mouse based on certain coordinates which i get from a depth image from kinect. but I have 30 frames/second(images/second) and those coordinates changes with every frame so the mouse keeps moving. My question is,Is there a way to smooth the movement of the mouse ? 回答1: Yes you can start tracking with some parameters that allows you to make move smoother. Below is an example code: var parameters = new TransformSmoothParameters { Smoothing = 0.2f, Correction

Clicking mouse by sending messages

不想你离开。 提交于 2019-12-04 03:23:06
问题 I'm trying to send mouse clicks to a program. As I don't want the mouse to move, I don't want to use SendInput or mouse_event, and because the window that should receive the clicks doesn't really use Buttons or other GUI events, I can't send messages to these buttons. I'm trying to get this working using SendMessage, but for some reason it doesn't work. Relevant code is (in C#, but tried Java with jnative as well), trying this on Vista [DllImport("user32.dll", CharSet=CharSet.Auto)] public

When a mousedown and mouseup event don't equal a click

匆匆过客 提交于 2019-12-04 02:37:21
I've been using some buttons for a while now that have a depressed effect as they are clicked using position relative and a top: 1px in the :active pseudo-class. I had problems with click events not firing and it turned out to be due to the mousedown and mouseup events not firing on the same element. I did a bit of fiddling to make sure the inner-most element covered the whole button and discovered that the issue remained. If I click right at the top of the text then the link jumps down (firing the mousedown event) and then back up (firing the mouseup event) but the click does not occur. If I

Assign Mouse Buttons in Visual Studio 2008

允我心安 提交于 2019-12-04 02:25:39
Does anyone know how to bind extra mouse buttons to commands in visual studio 2008? There used to be a "powertoy" that let you do it for visual studio 2003, but I can't find an equivalent for 2008. While AutoHotKey was interesting, it doesn't really do what I want to do, which is map buttons to keys in an application-specific context. I ended up finding this add-in: http://www.codeproject.com/KB/macros/MouseNavi.aspx which I just modified and threw into the AddIns directory for Visual Studio. AutoHotkey For anyone still looking for a solution that will work in any version of Visual Studio (as

jQuery: detecting cmd+click / control+click

一个人想着一个人 提交于 2019-12-04 00:04:56
i have the options of my web application in tabs. <ul id="tabs"> <li><a href="a.php">aaa</a></li> <li><a href="b.php">bbb</a></li> <li><a href="c.php">ccc</a></li> <li><a href="d.php">ddd</a></li> <li><a href="e.php">eee</a></li> </ul> When the user clicks on any tab (in the same window) there is a fadeout effect which i get with this code, and afterwards an automatic redirection: $('ul#tabs li a').click(function(e){ if(e.which == 1) { var link = $(this).attr('href'); $('#content').fadeOut('fast',function(){ window.location = link; }); } }); It works great, because it ignores the mouse middle

AutoComplete textbox and “Hide Pointer While Typing” in windows

心不动则不痛 提交于 2019-12-03 20:27:58
问题 How can the "Hide Pointer While Typing" option be disabled by application? I'm having an issue with the cursor hiding and not getting it back without pressing escape or losing window focus. The application has been written in C# and uses WPF. A technology specific answer is not required because it'll likely be possible using any technology. Here's the scenario: A user can type in a TextBox and an AutoComplete list shows up below the box. Once the user starts typing though, he/she can no

How to perform a Virtual Mouse click C# without using a mouse

核能气质少年 提交于 2019-12-03 20:17:36
I'd like to perform a click in a windows application, without using the real mouse (so I can minimize it). Much like a bot would behave. How would I do this? I think the function you're looking for is PostMessage [DllImport("user32.dll", SetLastError = true)] public static extern bool PostMessage(int hWnd, uint Msg, int wParam, int lParam); You can read more about it here on codeproject , and download a demo project, which sends keystrokes. This method posts messages directly on the input queue associated with the program, based on the process handle you use (hWnd) You can also use this