mouse

Is there a Delphi 'joystick' control?

﹥>﹥吖頭↗ 提交于 2019-12-13 16:42:35
问题 I'd like to align an object in X and Y by eye using the mouse to move it into position. I can roll a solution by using various spin controls (or buttons) but it's messy and I got to wondering whether there is a control - like a joystick - that provides 2-axis control using the mouse and fires events at rates which vary depending on its position? 回答1: Afaik Jedi (jedi apilib?) had a joystick header too. It is winapi, not COM, so no TLB involved 回答2: Try NLDJoystick, an open-source component

How to store (and use) the current mouse position?

时光毁灭记忆、已成空白 提交于 2019-12-13 16:15:51
问题 What is the best way to store the current mouse position (system-wide) and then (later) put the mouse at that stored point? [NSEvent mouseLocation] gets me the position, and I can move the mouse with a CGEventMouseMoved, but they each use a different co-ordinates system (I believe y=0 is the top for NSEvent and the bottom for a CGEvent). I'm worried about the robustness of capturing the screen height and using it to convert between the two - or is this the best approach? 回答1: Yes, using the

How to disable the keyboard and mouse via assembly code

喜你入骨 提交于 2019-12-13 11:22:44
问题 I have tried to write an assembly code to hang the keyboard and mouse (I try with keyboard now) . I searched in everywhere nearly (in references and articles and the old topic here also) and almost all show the same code by fetch the address of INT 9 and create new interrupt then make it be called rather than the original interrupt(9) . That is my code i had written: .model tiny .stack 100h .data old_ISR dd ? .code main proc far mov ah,35h ; get interrupt vector mov al,09 ; for int 9 INT 21h

JavaScript Closest point from mouse

纵饮孤独 提交于 2019-12-13 09:54:02
问题 Before you comment, yes i have checked other questions aswell... like this article, or this one, or maybe even this one. However, i couldn't find how to set the point of origin. So, let's say i have an array picture X coords and picture Y coords (on a grid of 100*100) x /y 92/81 82/47 81/03 Now i have the mouseX and mouseY. Does anyone know how to make a function that gives you the closest point x and y values in JavaScript? Thanks in advance! 回答1: Just do some vecor math. Given the images

Java Swing Scrolling By Dragging the Mouse

社会主义新天地 提交于 2019-12-13 06:16:06
问题 I am trying to create a hand scroller that will scroll as you drag your mouse across a JPanel. So far I cannot get the view to change. Here is my code: import java.awt.*; import java.awt.event.*; import javax.swing.*; public class HandScroller extends JFrame { public static void main(String[] args) { new HandScroller(); } public HandScroller() { setDefaultCloseOperation(EXIT_ON_CLOSE); final JPanel background = new JPanel(); background.add(new JLabel("Hand")); background.add(new JLabel(

Resize code does not correspond with mouse movement

强颜欢笑 提交于 2019-12-13 06:03:56
问题 I have some code to resize a chatpanel dynamically, but it does not move according to the mouse. What happens is the mouse moves at a faster rate than the panel gets resized. For example, how I want it to be, is in any application, when you click on the border between two windows, and drag it, the mouse stays along with the piece you are clicking on, and currently this is not happening. here is my code. please let me know if you need more public void mouseDragged(MouseEvent e) { if(getCursor(

How could it work to use multiple cursors on one Windows client?

坚强是说给别人听的谎言 提交于 2019-12-13 04:17:37
问题 I recently searched the web for multi-cursor solutions and found a bunch of possibilities to emulate cursors in a given window, like MultiPoint SDK, but no solutions where one can use multiple cursors on the whole desktop (and thus not restricted to one application). I almost gave up, thinking the Windows architecture makes it impossible, but then I found MultiMouse, stating in this video on YouTube, it would at least make it possible to use different cursors for different users over the

Can you program buttons on a gamepad to bind with mouse/keyboard input?

廉价感情. 提交于 2019-12-13 03:46:48
问题 I was wondering if there was a way to write a program that could bind buttons on a gamepad to certain mouse/keyboard inputs. For example moving an analog stick on the gamepad to move the mouse, and clicking certain buttons on the gamepad == pressing keyboard keys or mouse clicks. Which language would be able to do this? 回答1: Sure, its possible. You just need some sort of Joystick interface that allows you to read its actions and then your program can translate it into other actions sent to

wpf: capturing mouse does not work

烈酒焚心 提交于 2019-12-13 03:24:34
问题 I am developing an kind of outlook calendar application where I need to make the appointment resizable from mouse. My first try with a thumb did not work properly so I tried another way. What I did is that: 1) on the botton of the appointmennt panel I added a rectangle to figure out the resize zone (the thumb). The appointment panel is put on a grid panel. 2) I intercept down event on the rectangle and send event to this code: private Point startPoint; private void OnResizeElementMouseDown

rotate to mouse kinetic js

五迷三道 提交于 2019-12-13 03:04:12
问题 I looked at many examples but so far nothing worked. I want the circle to rotate on mousemove and it is rotating centered, so no problems so far. But, it does a 180 jump when I pass half of the stage. So everything is fine till I pass the half of the stage, clearly I'm missing something. Math.atan2 gives me an error: the circle jumps to the (0,0) of the stage. Please help I really need this badly. Thanks in advance! new Kinetic.Tween({ node: cGrad1, x: stage.getWidth()/2, y: stage.getHeight()