Search Results

Search found 5348 results on 214 pages for 'mouse'.

Page 22/214 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • Detect when mouse leaves my app

    - by user593747
    Hello I am creating an app in win32 that will display the x, y position(In screen coords) of the mouse whereever the mouse is (inside my app client/NC area & outside). I am at the stage where I want to detect when the mouse leaves my application completely. I have written a simple win32 app that should detect & notify myself when the mouse leaves my app, BUT its not working, I never receive the messages WM_MOUSELEAVE & WM_NCMOUSELEAVE. What do you think is wrong? Am I using the wrong win32 functions? // Track Mouse.cpp : Defines the entry point for the application. // #include "stdafx.h" #include <windows.h> #include <vector> #include <string> #include <cstdlib> static HINSTANCE gInstance; // Globals // enum MouseStatus { DEFAULT = 50001, LEFT_CLIENT, LEFT_NCLIENT }; static MouseStatus mouseState = DEFAULT; static COLORREF bkCol = RGB(0,255,255); // Functions List // BOOL TrackMouse( HWND hwnd ) { // Post: TRACKMOUSEEVENT mouseEvt; ZeroMemory( &mouseEvt, sizeof(TRACKMOUSEEVENT) ); mouseEvt.cbSize = sizeof(TRACKMOUSEEVENT); mouseEvt.dwFlags = TME_LEAVE | TME_NONCLIENT; //mouseEvt.dwHoverTime = HOVER_DEFAULT; mouseEvt.hwndTrack = hwnd; return TrackMouseEvent( &mouseEvt ); } LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_CREATE: { // Track mouse so I can be notified when it leaves my application (Client & NC areas) BOOL trackSuccess = TrackMouse( hwnd ); // Returns successful, so I correctly track the mouse if ( trackSuccess == 0 ) { MessageBoxW( hwnd, L"Failed to track mouse", L"Error", MB_OK|MB_ICONEXCLAMATION ); } else MessageBoxW( hwnd, L"Tracking mouse", L"Success", MB_OK|MB_ICONEXCLAMATION ); } break; case WM_MOUSELEAVE: { // I never receive this message // Detect when the mouse leaves the client area mouseState = LEFT_CLIENT; bkCol = RGB(50,50,50); InvalidateRect( hwnd, NULL, true ); } break; case WM_NCMOUSELEAVE : { // I never receive this message // If the mouse has left the client area & then leaves the NC area then I know // that the mouse has left my app if ( mouseState == LEFT_CLIENT ) { mouseState = LEFT_NCLIENT; BOOL trackSuccess = TrackMouse( hwnd ); if ( trackSuccess == 0 ) { bkCol = RGB(255,255,0); MessageBoxW( hwnd, L"On WM_NCMOUSELEAVE: Failed to track mouse", L"Error", MB_OK|MB_ICONEXCLAMATION ); } else MessageBoxW( hwnd, L"On WM_NCMOUSELEAVE: Tracking mouse", L"Success", MB_OK|MB_ICONEXCLAMATION ); InvalidateRect( hwnd, NULL, true ); } } break; case WM_ACTIVATE: case WM_MOUSEHOVER: { // The mouse is back in my app mouseState = DEFAULT; bkCol = RGB(0,255,255); InvalidateRect( hwnd, NULL, true ); } break; case WM_PAINT: { HDC hdc; PAINTSTRUCT ps; hdc = BeginPaint( hwnd, &ps ); SetBkColor( hdc, bkCol ); Rectangle( hdc, 10, 10, 200, 200 ); EndPaint( hwnd, &ps ); } break; case WM_CLOSE: DestroyWindow(hwnd); break; case WM_DESTROY: PostQuitMessage(0); break; default: break; } return DefWindowProc(hwnd, msg, wParam, lParam); } int WINAPI WinMain(HINSTANCE gInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { WNDCLASSEX wc; HWND hwnd; MSG Msg; wc.cbSize = sizeof(WNDCLASSEX); wc.style = 0; wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = gInstance; wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)(DKGRAY_BRUSH); wc.lpszMenuName = NULL; wc.lpszClassName = L"Custom Class"; wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION); // if registration of main class fails if(!RegisterClassEx(&wc)) { MessageBoxW(NULL, L"Window Registration Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK); return 0; } hwnd = CreateWindowEx( WS_EX_CLIENTEDGE, L"Custom Class", L"App Name", WS_CAPTION|WS_MINIMIZEBOX|WS_VISIBLE|WS_OVERLAPPED|WS_SYSMENU, CW_USEDEFAULT, CW_USEDEFAULT, 600, 500, NULL, NULL, gInstance, NULL); if(hwnd == NULL) { MessageBoxW(NULL, L"Window Creation Failed!", L"Error!", MB_ICONEXCLAMATION | MB_OK); return 0; } ShowWindow(hwnd, nCmdShow); UpdateWindow(hwnd); while(GetMessage(&Msg, NULL, 0, 0) > 0) { TranslateMessage(&Msg); DispatchMessage(&Msg); } return Msg.wParam; }

    Read the article

  • Isometric - precise screen coordinates to isometric

    - by Rawrz
    I'm trying to translate mouse coords to precise isometric coords (I can already find the tile the mouse is over, but I want it to be more precise). I've tried several different methods but I seem to keep falling short. For drawing I use: batch.draw( texture, (y * tileWidth / 2) + (x * tileWidth / 2), (x * tileHeight / 2) - (y * tileHeight / 2)) This is what I currently use for figuring out a tile position: float xt = x + camPosition.x - (ScreenWidth/2) ; float yt = (ScreenHeight) - y + camPosition.y - (ScreenHeight/2); int tileY = Math.round((((xt) / tileWidth) - ((yt) / tileHeight))); int tileX = Math.round((((xt) / tileWidth) + ((yt) / tileHeight))- 1); I'm just wondering how I could update these to allow for more precise coordinates, instead of tile only. EDIT: Following what ccxvii said below, and removing the -1 from tileX, the object follows my mouse just like I had wanted. Just going to re-examine the math and figure out if that change will result in other messes =o

    Read the article

  • cursor jumps when moving (and some other times)

    - by nyne
    i updated to 12.10 beta 1 when it was released (coming from 12.04 fresh install, i skipped the alpha releases of 12.10) since then i've done all the usual updates but ive had an issue with my cursor jumping. it does not jump when typing, i've done a lot of searching and cant find an answer, it tends to happen most when i move the cursor the jump is maybe 15-20 pixels down and to the right it seems like a display issue because if i hover over a link or the x to close a window the cursor will settle in it's down/right position, but the whatever im hovering over will still act as if that's where the mouse is, and clicking still works on the item. so the mouse is actually in its original location, but it's displaying offset and flickering back and forth from its down/right position and its correct position this makes use very difficult because the mouse is never displayed where it actually is and i have to estimate my clicks any ideas?

    Read the article

  • Simulating mouse clicks on Mac OS X does not work for some applications.

    - by Thomi
    I'm writing an application for Mac OS X 10.6 and later in C++. One part of the application needs to simulate mouse movement and mouse clicks. I do this currently by posting CGEvent objects using CGEventPost(kCGHIDEventTap, event);. This works, for the most part - I can simulate mouse movement and clicks just fine, but it seems to fail in some areas. For example: In Mozilla Firefox and Safari, I can click on all the menus, but cannot click on a link within a website. When I try, the link is highlighted, but the browser never follows the link. However, I can right-click on a link, select "open link in new tab", and everything works as expected. Solved - creating the mouse event using CGEventCreateMouseEvent(...) makes the event work within web browser. I can click on the "Dashboard" icon to brink up the dashboard, but I cannot click on the "i" button on any of the dashboard widgets. Similarly, clicking on any of the search results from the spotlight search widget doesn't work either. This inconsistency is along application boundaries. What might be the cause?

    Read the article

  • Show underlying applications mouse cursor when hovering over visible section of my application.

    - by Dylan Vester
    I am writing a WPF application that allows the user to draw over the entire screen when the right mouse button is held down. I use a full screen transparent overlay form to achieve this, however, as I draw lines with the mouse, what's happening is that the portion of my window that contains the line is becoming visible (as expected). The undesired effect of this is that if the line is over a part of another application such as a textbox, or hyperlink, this changes the cursor back to the default cursor my my app (arrow), instead of the other applications desired cursor (IBeam). I want my overlay to be seamless to the user, and just show their drawing path, rather than have any interaction with the mouse cursor. See my example below:

    Read the article

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

    - by EagleOfToledo
    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 how to detect clicks on these extended mouse buttons?

    Read the article

  • Simulating mouse clicks on Mac OSX does not work for some applications.

    - by Thomi
    Hi, I'm writing an App for Mac OSX 10.6 and later in C++. One part of theapp needs to simulate mouse movement and mouse clicks. I do this currently by posting CGEvent objects using CGEventPost(kCGHIDEventTap, event);. This works, for the msot part - I can simulate mouse movement and clicks just fine, but it seems to fail in some areas. For example: In Mozilla firefox & Safari, I can click on all the menus, but cannot click on a link within a website. When I try, the link is highlighted, but the browser never follows the link. However, I can right-click on a link, select "open link in new tab", and everything works as expected. I can click on the "Dashboard" icon to brink up the dashboard, but I cannot click on the "i" button on any of the dashboard widgets. This inconsistency is along application boundaries - Does anyone have any idea what the cause might be?

    Read the article

  • Simulating mouse clicks on Mac OSX does not work for some applications.

    - by Thomi
    Hi, I'm writing an App for Mac OSX 10.6 and later in C++. One part of theapp needs to simulate mouse movement and mouse clicks. I do this currently by posting CGEvent objects using CGEventPost(kCGHIDEventTap, event);. This works, for the msot part - I can simulate mouse movement and clicks just fine, but it seems to fail in some areas. For example: In Mozilla firefox & Safari, I can click on all the menus, but cannot click on a link within a website. When I try, the link is highlighted, but the browser never follows the link. However, I can right-click on a link, select "open link in new tab", and everything works as expected. I can click on the "Dashboard" icon to brink up the dashboard, but I cannot click on the "i" button on any of the dashboard widgets. This inconsistency is along application boundaries - Does anyone have any idea what the cause might be?

    Read the article

  • What is the best method for implementing mouse wheel activity in Delphi VCL forms?

    - by Brian Frost
    As a long time user of Delphi 7, I've rolled my own mouse wheel handling in a few controls but lately I've noticed that some recent applications only need the mouse cursor to be placed over a control (e.g a list box or tree view) for the mouse wheel activity to cause that control to scroll. This feels nice (as opposed to having to click focus a control before it responds to the wheel. Now I've moved to Delphi 2010 I'm wondering what is the 'correct' behavior? And what can I use in Delphi that avoids me having to bodge this with my own solutions now? Thanks.

    Read the article

  • X11: How do I REALLY grab the mouse pointer?

    - by Drew Hall
    I've implemented a horizontal splitter widget in Xlib. I'm trying to grab the mouse when the user clicks & drags on the splitter bar (so that the user can dynamically move the split & thus resize the windows on either side of the splitter bar). I've used XGrabPointer() after receiving a left click, in hopes that all future mouse motion (dragging) will be diverted to the splitter window until the left button is released. Unfortuntately, it doesn't seem to work like that. If the user drags too quickly and the mouse pointer enters one of the windows on either side of the split, the MotionEvent messages are diverted to that (child) window rather than the splitter window. What have I done wrong? My XGrabPointer() call is as follows: ::XGrabPointer(mDisplay, window, True, ButtonPressMask | ButtonReleaseMask | PointerMotionMask | FocusChangeMask | EnterWindowMask | LeaveWindowMask, GrabModeAsync, GrabModeAsync, RootWindow(mDisplay, DefaultScreen(mDisplay)), None, CurrentTime);

    Read the article

  • What is the best method for implementing mouse wheel activity in Delph1 VCL forms?

    - by Brian Frost
    As a long time user of Delphi 7, I've rolled my own mouse wheel handling in a few controls but lately I've noticed that some recent applications only need the mouse cursor to be placed over a control (e.g a list box or tree view) for the mouse wheel activity to cause that control to scroll. This feels nice (as opposed to having to click focus a control before it responds to the wheel. Now I've moved to Delphi 2010 I'm wondering what is the 'correct' behaviour? And what can I use in Delphi that avoids me having to bodge this with my own solutions now? Thanks.

    Read the article

  • looking for a clock widget that is unaffected by the mouse

    - by Joshua Robison
    Between screenlets, cairo-dock widgets and plasma-widgets. One of them's gotta have this function; A widget that hovers above everything on the desktop but is completely unaffected by the mouse. I would use this by making a clock hover above everything and semi transparent. I also want to be able to click on windows underneath the clock. After some experimentation, the screenlets widgets do not do what I am asking. I can make them float above everything on the screen but I am not able to click on windows underneath them. I need the widget to be COMPLETELY unaffected by the mouse.

    Read the article

  • Preview YouTube Videos On Mouse Over–Chrome Extension

    - by Gopinath
    YouTube video preview is a nice Google Chrome extension that let you preview YouTube videos without playing them. After installing the plugin, users can hover mouse on any of the YouTube video thumbnails displayed on YouTube website to preview the video. This plugin tries to imitate the beautiful Bing Video search results preview feature by displaying 3 frames of video. The plugin does not work outside YouTube website. May be you can give a try to this plugin.  Download YouTube Video Preview Extension This article titled,Preview YouTube Videos On Mouse Over–Chrome Extension, was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • Firefox: middle mouse button stopped working

    - by diversario
    In Firefox, middle mouse button/wheel has been assigned "Open link in new tab" action for a while now, by default. Since I ran Software Update tonight, this action doesn't work in Firefox anymore. To be specific, middle mouse click doesn't open links anymore. At the same time, it closes tabs just fine (middle-click a tab == 'Close tab'). I don't know the update details, but I remember that Firefox update was there among other things. I tried running Firefox with a clean profile and middle button did work there, so something must've changed with existing settings.

    Read the article

  • Failed Update & Mouse Issues

    - by James
    I`m using my gfs computer - but I do have Ubuntu 11.10 up and running well to some degree. Still need to work out some bugs but not quite sure how to do that. My mouse is only somewhat responsive - cursor moves, and able to click on things but still unable to do a double click function. Left mouse button still not working at all. Tried running updates but it keeps coming up synaptic error. Not sure what that means. I have read that some people have done reinstalls of Ubuntu and it corrected the problems - not sure if that could work. Comments would be appreciated. Installed Ubuntu 11.10 but thinking of trying to wipe the system to do a fresh install can someone tell me how I get back to the Ubuntu installation menu. Wondering if gnome may need to be reset but not sure.

    Read the article

  • Double launchers and mouse captured between screens in Twinview configuration

    - by Numpty
    Just upgraded to 12.04 and noticed an extremely annoying issue. While using twinview, there now appears to be a launcher on each screen. Moving the mouse between monitors and over the launcher "captures" the mouse for half a second or so, creating the perception of lag. According to some bug reports I've read it appears that a launcher on every screen is a new "feature". Is there any way I can get rid of the 2nd launcher? It's driving my crazy.

    Read the article

  • External monitor with NO mouse cursor

    - by Csaba Nyerges
    I am using a Fujitsu Siemens Amilo L7310 laptop computer with an external monitor. I'm wishihg to use version 10.04. The problem is, when I plug my laptop into the external monitor with my laptop screen turned either on or off, I do not see the mouse cursor on the external monitor! The mouse cursor is still there, although invisible. If I connect the external monitor to my laptop before swithing both on, the same happens. Is there any solution to make the cursor appear on the monitor?

    Read the article

  • Scaling an image using the mouse in a WinForms application?

    - by Gaax
    I'm trying to use the position of the mouse to calculate the scaling factor for scaling an image. Basically, the further you get away from the center of the image, the bigger it gets; and the closer to the center you get, the smaller it gets. I have some code so far but it's acting really strange and I have absolutely no more ideas. First I'll let you know, one thing I was trying to do is average out 5 distances to get a more smooth resize animation. Here's my code: private void pictureBoxScale_MouseMove(object sender, MouseEventArgs e) { if (rotateScaleMode && isDraggingToScale) { // For Scaling int sourceWidth = pictureBox1.Image.Width; int sourceHeight = pictureBox1.Image.Height; float dCurrCent = 0; // distance between the current mouse pos and the center of the image float dPrevCent = 0; // distance between the previous mouse pos and the center of the image System.Drawing.Point imgCenter = new System.Drawing.Point(); imgCenter.X = pictureBox1.Location.X + (sourceWidth / 2); imgCenter.Y = pictureBox1.Location.Y + (sourceHeight / 2); // Calculating the distance between the current mouse location and the center of the image dCurrCent = (float)Math.Sqrt(Math.Pow(e.X - imgCenter.X, 2) + Math.Pow(e.Y - imgCenter.Y, 2)); // Calculating the distance between the previous mouse location and the center of the image dPrevCent = (float)Math.Sqrt(Math.Pow(prevMouseLoc.X - imgCenter.X, 2) + Math.Pow(prevMouseLoc.Y - imgCenter.Y, 2)); if (smoothScaleCount < 5) { dCurrCentSmooth[smoothScaleCount] = dCurrCent; dPrevCentSmooth[smoothScaleCount] = dPrevCent; } if (smoothScaleCount == 4) { float currCentSum = 0; float prevCentSum = 0; for (int i = 0; i < 4; i++) { currCentSum += dCurrCentSmooth[i]; } for (int i = 0; i < 4; i++) { prevCentSum += dPrevCentSmooth[i]; } float scaleAvg = (currCentSum / 5) / (prevCentSum / 5); int destWidth = (int)(sourceWidth * scaleAvg); int destHeight = (int)(sourceHeight * scaleAvg); // If statement is for limiting the size of the image if (destWidth > (currentRotatedImage.Width / 2) && destWidth < (currentRotatedImage.Width * 3) && destHeight > (currentRotatedImage.Height / 2) && destWidth < (currentRotatedImage.Width * 3)) { AForge.Imaging.Filters.ResizeBilinear resizeFilter = new AForge.Imaging.Filters.ResizeBilinear(destWidth, destHeight); pictureBox1.Image = resizeFilter.Apply((Bitmap)currentRotatedImage); pictureBox1.Size = pictureBox1.Image.Size; pictureBox1.Refresh(); } smoothScaleCount = -1; } prevMouseLoc = e.Location; currentScaledImage = pictureBox1.Image; smoothScaleCount++; } }

    Read the article

  • Remote mouse pointer not visible in VNC

    - by aef
    I used VNC desktops as a kind of collaboration server, as shared planning and pair programming environment for a long time. Now my latest iteration uses a KVM guest running Fedora 17 "Beefy Miracle", the Cinnamon desktop environment and an X11VNC server. The X11VNC server is automatically started with the desktop environment using the following command: x11vnc -localhost -many -shared -display :0 -bg My problem is that depending on the VNC client, the mouse pointer of the remote system which is shown through VNC is not synchronized to my client. I really need this, so I can see what my partner is doing on the desktop. When using Vinagre 3.2.1 on Ubuntu Oneiric Ocelot (11.10) or Vinagre 2.3.0.3 on Debian Squeeze (6.0) and I don't have my local mouse pointer inside the VNC view, I cannot see the mouse pointer of my remote system, nor its movement. When using TightVNC on Windows 7, I can recognize a mouse pointer trace for very short amounts of time after moving the mouse, but it is not clearly visible. Using UltraVNC on Windows 7 the mouse pointer is clearly visible all the time. With Gnome 2 I never had any problems with remote pointer synchronization, using exactly the same clients. I suspect this could have something to do with Cinnamon's dependency on 3D acceleration. On the other hand, it doesn't change anything to start Cinnamon's fallback environment Cinnamon 2D. Update: Same effect when I use Gnome 3.

    Read the article

  • Dell Docking Station Doesn’t Detect USB Mouse and Keyboard

    - by Ben Griswold
    I’ve found myself in this situation with multiple Dell docking stations and multiple Dell laptops running various Windows operating systems.  I don’t know why the docking station stops recognizing my USB mouse and keyboard – it just does.  It’s black magic.  The last time around I just starting plugging the mouse and keyboard into the docked laptop directly and went about my business (as if I wasn’t completing missing out on a couple of the core benefits of using a docking station.)  I guess that’s what happens when you forget how you got yourself out of the mess the last time around.  I had been in this half-assed state for a couple of weeks now, but a coworker fortunately got themselves in and out of the same pickle this morning.  Procrastinate long enough and the solution will just come to you, right? Here’s how to get yourself out of this mess: Undock your computer Unplug your docking station Count to an arbitrary number greater than 12.  (Not sure this is really required, but…) Plug your docking station back in Redock your machine I put my machine to sleep before taking the aforementioned actions.  My coworker completely shutdown his laptop instead.  The steps worked on both of our Win 7 machines this morning and, who knows, it might just work for you too. 

    Read the article

  • Ubuntu 14.04, only wallpaper and a mouse cursor is showing

    - by Abhishek Verma
    I upgraded to Ubuntu 14.04 weeks ago, that was a fresh install. And as usual installed, Unity tweak tool, some themes, Chrome, eclipse etc. Today, while playing with Unity tweak tool, I mistakenly switched Window spread to off, and bang, no problem yet. After realizing what I did I switched it to on again and then, the title bar of all windows, the status bar (guessing it's called that), and the launcher disappeared. Now I was left with a mouse cursor and the Unity tweak tool window, without the title bar. I thought a restart is needed, but sadly no shutdown option to click on, moreover, the keyboard didn't worked, neither the hardware shutdown button. So, I pressed the reset button. After a mundane restart, I was welcomed by the wallpaper and the mouse cursor, moving, that's it. Searched everywhere for a working solution, found some solutions in AskUbuntu itself, but they where all old and required terminal to be used, but since my keyboard isn't working, no access to the terminal. So, ofcource the question isn't a dublicate, at least, IMHO. Also, I was working on an Android project and have got no backups, so I won't be going for a clean install, or else I will start crying watching my weeks of work being deleted, any solutions, please.

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >