mouse

How can you detect a mouse-click event on an Image object in Java?

*爱你&永不变心* 提交于 2019-12-01 15:18:29
问题 Implementing " Kings' Corners " (glorified multiplayer Solitaire) in Java. I'm trying to allow a player to drag a card (image) from their hand to somewhere else on the table. The problem is that the player's hand is "fanned" so the images of the cards are rotated and they overlap. Here is an example of a hand: I've considered making each card a JPanel , but the issue then is that I'd have to paint the card rotated inside its rectangular JPanel , as they themselves can't be rotated. Ideally I

Zoom on Canvas, centered on mouse position

霸气de小男生 提交于 2019-12-01 14:26:50
I know there are several posts on stack and others websites, but it seems I still make something wrong. When I zoom with MouseWheel event, the zoom is always not centered, but the left side of my canvas always stays on the left on my ViewBox, so when I zoom in, I only can see the left of my canvas. XAML code : <Grid x:Name="MainGrid"> <Viewbox x:Name="ViewBoxDessin" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center"> <Canvas x:Name="monDessin" Background="WhiteSmoke" MouseWheel="monDessin_MouseWheel"> <Canvas.LayoutTransform> <ScaleTransform x:Name="st" ScaleX="1" ScaleY="

Move mouse cursor using javascript in Chrome or Firefox using any method (Plugin, GreaseMonkey?)

末鹿安然 提交于 2019-12-01 12:49:57
问题 I have need to move the mouse cursor position in the browser, I can use any method as long as its in Google Chrome or Firefox, one or the other. In the best case, I would like to control the mouse position with javascript. Any easy way to do this? Thanks! Phil 回答1: I don't think this is possible. Altough Greasemonkey gives some additional features (like Cross-Server XMLHttpRequests), I don't think this has been implemented. Perhaps what you are looking for is a feature available for Firefox

Zoom on Canvas, centered on mouse position

泄露秘密 提交于 2019-12-01 12:29:37
问题 I know there are several posts on stack and others websites, but it seems I still make something wrong. When I zoom with MouseWheel event, the zoom is always not centered, but the left side of my canvas always stays on the left on my ViewBox, so when I zoom in, I only can see the left of my canvas. XAML code : <Grid x:Name="MainGrid"> <Viewbox x:Name="ViewBoxDessin" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center"> <Canvas x:Name="monDessin" Background="WhiteSmoke"

8086 assembly right mouse click interrupts

陌路散爱 提交于 2019-12-01 12:10:41
I am working on a project in 8086 assembly on windows machine and I need to know which mouse button has been clicked. What are the interrupts for this? or how do I go about finding this out? Thanks matja If you're making a DOS program that runs under windows, you can use software interrupt 0x33, function 3, which returns the button status in the BL register : mov ax,0x3 int 0x33 test bl,1 jnz left_button_pressed test bl,2 jnz right_button_pressed More info here http://www.ctyme.com/intr/rb-5959.htm If you're making a native Windows application, you can test for button presses by checking for

Moving the mouse according to the given coordinates

旧城冷巷雨未停 提交于 2019-12-01 11:58:48
问题 what I want is, after recording the mouse movement and saving the coordinates/ indexes/ position, I will have to load the mouse coordinates and make the mouse move according to the loaded coordinates i don't have code to show you because am stuck at this point ' private void button3_Click_1(object sender, EventArgs e) { StreamWriter writer; SaveFileDialog saveFileDialog1 = new SaveFileDialog(); string[] cvsArray = new string[10000]; saveFileDialog1.Filter = "All files (*.All)|*.All|All files

Mouse movement capture

让人想犯罪 __ 提交于 2019-12-01 11:18:39
问题 I have an application wich open a modal form with the ShowDialog method. Once this form is displayed I want to capture the mouse movement even if the cursor is outside the form. How can I capture the mouse movement? I saw something with the Capture property but I cannot manage to make it work. [edit] I want to be notified if the mouse move outside the form. 回答1: The Capture property is the correct way, but there are some limitations. Only the foreground window can capture the mouse Mouse

Visualize / Show mouse cursor position in selenium 2 tests (for example PHPUnit Webdriver)

…衆ロ難τιáo~ 提交于 2019-12-01 11:07:43
I am running \PHPUnit_Extensions_Selenium2TestCase to run tests which move the mouse and make clicks ( $this->moveto ). For improved debugging and viewing experience I want to see where the mouse cursor is currently at. The system mouse cursor is not moved using the above methods. Alex Execute a javascript after each page load which enabled the mouse cursor display. /** * Enable mouse cursor display */ protected function enableCursor() { $this->execute(array('script' => <<<EOF var seleniumFollowerImg=document.createElement("img"); seleniumFollowerImg.setAttribute('src', 'data:image/png;base64,

Mouse hook with C#

放肆的年华 提交于 2019-12-01 10:52:40
问题 I am trying to emulate "hardware" mouse clicks as it appears that some software blocks input from PostMessage for instance. I know there's SendInput, but that's not an option as I need this to be compatible in background windows as well. The solution seems to be a low-level mouse hook but I've searched around and couldn't find anything other than just the loggers, no manipulation of moving mouse, clicking etc. I'd like this to happen without having to write some sort of C++/C wrapper to use

Moving Shape via Mouse in Opengl

一曲冷凌霜 提交于 2019-12-01 10:42:00
void Rectangle(void) { glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_QUADS); glColor3f(1.0,0.0,0.0); glVertex2f(m_x-0.25,m_y-0.25); glColor3f(1.0,0.0,0.0); glVertex2f(m_x-0.25,m_y-0.75); glColor3f(1.0,0.0,0.0); glVertex2f(m_x-0.75,m_y-0.75); glColor3f(1.0,0.0,0.0); glVertex2f(m_x-0.75,m_y-0.25); glEnd(); glutSwapBuffers(); I want to move the rectangle to where pressed mouse. m_x and m_y are global variable.This function has called in main glutDisplayFunc(Rectangle), mouse function like this: void mouse(int button,int state,int x,int y) switch(button) { case GLUT_LEFT_BUTTON: if(state==GLUT_DOWN) {