mouse

Javascript mouse event not captured properly when mouse moved very fast

最后都变了- 提交于 2019-12-30 10:56:39
问题 I am using JavaScript mouseover and mouseout events when I move my mouse very quickly the events are not triggered. Can you tell me what the problem is? Please let me know how to solve this. Also let me know if anything else is needed. Here is the code HTML 4 => qq[ <ul id="primary"> <li id="firstTab" onmouseover="changeSecondaryMenu('index','explore');" onmouseout="changeSecondaryMenu('explore');"><a></a></li> <li id="secondTab" onmouseover="changeSecondaryMenu('home','explore');" onmouseout

Setting a timeout on ifstream in C++?

[亡魂溺海] 提交于 2019-12-30 10:33:43
问题 We're trying to read data from 2 usb mice connected to a linux box (this data is used for odometry/localization on a robot). So we need to continuously read from each mouse how much it moved. The problem is that when a mouse is not moving, it doesn't send any data, so the file stream from which we get the data blocks execution and therefore the program can't do the odometry calculations (which involve time measurement for speed). Is there a way to set a timeout on the input stream (we're

Setting a timeout on ifstream in C++?

时间秒杀一切 提交于 2019-12-30 10:32:41
问题 We're trying to read data from 2 usb mice connected to a linux box (this data is used for odometry/localization on a robot). So we need to continuously read from each mouse how much it moved. The problem is that when a mouse is not moving, it doesn't send any data, so the file stream from which we get the data blocks execution and therefore the program can't do the odometry calculations (which involve time measurement for speed). Is there a way to set a timeout on the input stream (we're

How to track mouse position from on page load as well as on mouse move?

↘锁芯ラ 提交于 2019-12-30 08:11:26
问题 I am tracking mouse movements using the following JavaScript: var mouseX = 0; var mouseY = 0; document.onmousemove = function (e) { mouseX = e.clientX; mouseY = e.clientY; } My problem is that if the mouse hasn't been moved since the page had been loaded, the mouseX and mouseY values both equal 0. How can I get the mouse values when the page is loaded as well as when the mouse is moved? 回答1: The browser doesn't know where the mouse is until it moves. It's more complicated than just "get me

How to Detect Forward and Back Mouse Button Events in Delphi?

放肆的年华 提交于 2019-12-30 06:29:48
问题 If a mouse has other buttons in addition to the standard left/right/middle (e.g. forward/back), how can we detect those button clicks in Delphi? An example of how this is used is the Internet Explorer, where the forward/back button on the side of a Logitech or MS mouse cycles forward and back between any loaded web pages. This seems to replicate the Backspace/CTRL+Backspace on the keyboard but I tried to detect that using KeyPreview and the KeyPress event but it does not pick it up. Any idea

Low level mouse hook and DirectX

…衆ロ難τιáo~ 提交于 2019-12-30 04:24:25
问题 I'm building an application which needs to filter some mouse clicks system-wide. That is, I need to make the system ignore some mouse button clicks at special occasions. I use low level mouse hook and SetWindowsHookEx to filter out these clicks. It works relatively well, except for WPF applications. I guess that's because these applications use DirectX and DirectInput for input processing, and that's why I can't filter out clicks in these applications, since they get the input directly from

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

眉间皱痕 提交于 2019-12-29 07:09:10
问题 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/...? 回答1: 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' ) 回答2: I know the question is old, but I just discovered xdotool

How do I change the style of the cursor with JQuery?

Deadly 提交于 2019-12-29 06:35:14
问题 I want to change the style of the cursor as if it were going over a link. How do I do this? 回答1: Modify the CSS cursor value by using the css() method $('#selector').css('cursor', 'pointer'); Demo : http://jsfiddle.net/jomanlk/H6Nta/ 回答2: you can play around with this $('#divid').css('cursor','default'); for pointer $('#divid').css('cursor','pointer'); api http://api.jquery.com/css/ 回答3: using css http://www.echoecho.com/csscursors.htm read here for different cursor styles and apply it $('

JScrollPane - Zoom relative to mouse position

混江龙づ霸主 提交于 2019-12-29 03:41:43
问题 I need to calculate the new position of the viewport when zooming in to an image. The UI is built up as follows: ImagePanel draws the image ImagePanelWrapper is a JPanel wrapping around the imagePanel JScrollPane contains the ImagePanelWrapper When zooming in or out, the ImagePanel's zoom factor is changed and the preferred size of the ImagePanel is being recalculated. Therefore the image on this panel moves, even though the ImagePanel stays at the same viewport point. The following methods

How do I drag and drop a row in a JTable?

依然范特西╮ 提交于 2019-12-28 08:39:49
问题 How do you setup a JTable to be able to drag a row to a different index in the table. For example if I have 5 rows and I want to drag the 4th row to the 2nd position? 回答1: Check out the drag and drop section of the Java Tutorial. There are some examples on how to implement this for JTable . 回答2: The following allows JTable re-ordering of a single dragged row: table.setDragEnabled(true); table.setDropMode(DropMode.INSERT_ROWS); table.setTransferHandler(new TableRowTransferHandler(table)); Your