mouse

Mouseup bug in all browsers except Firefox?

落花浮王杯 提交于 2019-11-29 10:20:22
Mouseup doesn't fire on scroll bar for elements dynamically added (except Firefox): CSS: #dBox { height: 100px; width: 230px; overflow - y: auto; } HTML: <input type="text" id="s"> JQuery: $(function() { $('#s').focus(function() { var $dbox = $('<ul id="dBox"></ul>'); for (i = 0; i < 10; i++) $dbox.append('<li>' + i + '</li>'); $(this).after($dbox); $dbox.bind("mouseup", function() { alert('in: '); //console.log ('in: '); }); }); }); // OR LIKE THIS $('#s').focus(function() { var $dbox = $('<ul id="dBox"></ul>'); for (i = 0; i < 10; i++) $dbox.append('<li>' + i + '</li>'); $(this).after($dbox)

How do I get another application's window handle passed to Delphi via a mouse click

孤街醉人 提交于 2019-11-29 08:51:18
How can I get the handle of a window to be passed to Delphi by the user selecting the window (could be any other aplication's window) by clicking with the mouse on it. In my Delphi app I could have a button the user clicks that starts this detection process as well as a label displaying the clicked on window's title in the Delphi app. When the user is satisfied he selected the correct window he could click the button in my Delphi app (which will be modal) to stop the selection process and let my app start doing to the other window what it needs to do... if you know what text is in the title of

Activate horizontal scrolling with mouse on ListView

青春壹個敷衍的年華 提交于 2019-11-29 08:46:43
I've got a custom horizontal ListView with custom ScrollViewer inside it's template (created with Blend). I want it to scroll horizontally when using mouse scrolling wheel. How can I do that? if you implement IScrollInfo you can override the MouseWheelUp to do MouseWheelLeft and down\right the in same way edit (much more simple): add to your ScrollViewer PreviewMouseWheel private void ScrollViewer_PreviewMouseWheel(object sender, MouseWheelEventArgs e) { if (e.Delta < 0) // wheel down { if (myScrollViewer.HorizontalOffset + e.Delta > 0) { myScrollViewer.ScrollToHorizontalOffset(myScrollViewer

“Hiding” System Cursor

对着背影说爱祢 提交于 2019-11-29 08:12:21
BACKGROUND: I'm trying to create a "mouse hiding" application that hides the user's mouse from the screen after a set amount of time. I've tried many things, and using SetCursor only hides the mouse from the current application, mine must be able to sit in the tray (for example) and still function. I think I've found a solution with SetSystemCursor except for one problem. MY PROBLEM: I need to be able to capture any kind of mouse cursor, and replace the exact same kind of mouse cursor. When replacing the mouse, I need to provide the id of the type of mouse I'd like to replace with the mouse

How to configure mouse enhance pointer precision programmatically

拈花ヽ惹草 提交于 2019-11-29 08:04:21
How to configure mouse enhance pointer precision programmatically in C++? I know that have some useful commands like SystemParametersInfo, for speed, ... int x = 15; SystemParametersInfo(SPI_SETMOUSESPEED, NULL, reinterpret_cast(x),SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE ); ... but I cannot find enhance precision---- According to the documentation for the SystemParametersInfo function and SPI_SETMOUSE : Sets the two mouse threshold values and the mouse acceleration. The pvParam parameter must point to an array of three integers that specifies these values. See mouse_event for further

How can I detect a held down mouse button over a PictureBox?

一个人想着一个人 提交于 2019-11-29 07:56:14
问题 I need to fire an event when the mouse is above a PictureBox with the mouse button already clicked and held down. Problems: The MouseDown and MouseEnter event handlers do not work together very well. For instance once a mouse button is clicked and held down, C# will fire the MouseDown event handler, but when the cursor moves over the PictureBox the MouseEnter event does not fire, until the mouse button is realeased. 回答1: When the mouse is pressed down most controls will then Control.Capture

How to set the mouse position under X11 (linux desktop)?

≡放荡痞女 提交于 2019-11-29 07:44:30
I'm wondering how to set the mouse cursor position under X11? Is it possible at all and if, where do I have to look for appropriate functions? X window system, KDE/Gnome/...? Sounds like you're using X, so what you probably want is XWarpPointer . To give an absolute position on the whole screen, use the Root Window as dest window. (You can get a quick and dirty list of X functions using ls /usr/share/man/man3/ | grep '^X' ) I know the question is old, but I just discovered xdotool and it seems great: http://www.semicomplete.com/projects/xdotool/ Try using xte command (part of xautomation

Prevent mouse from leaving my form

孤街浪徒 提交于 2019-11-29 07:00:29
I've attached some MouseMove and MouseClick events to my program and next up is one of these: Get "global" mouse movement, so that I can read the mouse location even outside the form. Prevent my mouse from leaving the form in the first place. My project is a game so it'd be awesome to prevent the mouse leaving my form like most other games do (ofc. you can move it out if you switch focus with alt+tab fe.) and taking a look at answers to other questions asking for global mosue movement, they seem pretty messy for my needs. Is there an easy way to prevent my mouse from going outside my form's

How do i detect if the user is “idle” with javascript?

别说谁变了你拦得住时间么 提交于 2019-11-29 06:52:48
I'm developing a "real-time" web application which sends AJAX requests to the server every 10 seconds. Obviously this is very bandwidth-intensive and I would like to know if there's any solution to this. My idea is checking if the user doesn't move his mouse for X seconds. How can I accomplish this? I think you're searching for this: https://github.com/jasonmcleod/jquery.idle You may want to listen for some or all of the following events: mouseMove, mouseClick, mouseUp, mouseDown, keyDown, keyUp, keyPress set a timer to go off after some duration of idleness (60 seconds?) and that will turn

JavaScript how to change mouse cursor to an image?

北战南征 提交于 2019-11-29 05:54:22
I've seen examples where you can change it to preset images that your operating system has; example: $('body').css('cursor', 'wait'); But how about my own /img/my_image.png? Thanks for any help. You can, by specifying a url to it in CSS: div { cursor:url(smiley.gif),url(myBall.cur),auto; } See http://www.w3schools.com/cssref/pr_class_cursor.asp The Jquery way to set a custom cursor (or default cursor as a fallback): $('selector').css({'cursor': 'url(/cursors/customMoveCursor.cur), default'}); I don't usually link external articles, but this one covers your needs. I've copied the relevant stuff