Search Results

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

Page 18/214 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Getting mouse position both in Internet explorer and firefox with javascript

    - by strakastroukas
    I read this article regarding creating popup notes with javascript and css The problem is that this one works only in IE since window.event is undefined in Firefox. // assigns X,Y mouse coordinates to note element note.style.left=event.clientX; note.style.top=event.clientY; So could you point me a fully working example? Or at least, how could i modify the javascript code to make it work in both internet browsers?

    Read the article

  • Getting mouse position in major internet browswers with javascript

    - by strakastroukas
    I read this article regarding creating popup notes with javascript and css The problem is that this one works only in IE since window.event is undefined in Firefox. // assigns X,Y mouse coordinates to note element note.style.left=event.clientX; note.style.top=event.clientY; So could you point me a fully working example? Or at least, how could i modify the javascript code to make it work in both internet browsers?

    Read the article

  • mouse wheel operates on scrollbar

    - by basicblock
    If a SWF file or even a component within it has scrollbars, wouldn't it make sense that if the user is hovered over that area (it's in focus) and uses the mouse wheel, that this movement would automatically translate to the scrollbar moving. Any ideas how this is done, the events or classes used for this? I'm open to outside components or classes too. I haven't started yet, but I'll do an item renderer because it's easy to give it scrollbar.

    Read the article

  • Disable click action after letting up a mouse wheel hold scroll in Chrome browser

    - by Joe Miller
    I apologize in advance for the confusing title, not sure what the best way to describe this action is. Basically, I am holding down the mouse wheel and then moving the mouse itself up and down to scroll (not actually rotating the mouse wheel forward or backward). This is often the most convenient way to scroll for me. Unfortunately, when I scroll in this way, and then let up the mouse wheel again, it performs a click action, so if the arrow happens to land on a link when I let up the mouse wheel, I end up inadvertently clicking that link. How can I prevent the mouse from performing a click action when I use the mouse wheel to scroll by holding it down and then letting it up when I am done scrolling? It seems like this is only happening in the Chrome browser. Thanks! Windows 7, Chrome Browser, Logitech Mouse

    Read the article

  • How can I do Mouse Selection In OpenGL 3.0?

    - by NoobScratcher
    Hello I'm pretty good programmer I've made my own 2D games in SDL and made a gui in 3D using Old OpenGL and Modern OpenGL but.. I'm having problems with trying to click 3D models with opengl I have no idea what to do too be honest. Do I read the area that I've clicked? or what do I do? 100% shore this has been asked before but I just don't know what to do...?? using : OpenGL 3.0 WIN32 API C++

    Read the article

  • Java Slick2d - How to translate mouse coordinates to world coordinates

    - by SYNYST3R1
    I am translating in my main class' render. How do I get the mouse position based on the translation? public void render(GameContainer gc, Graphics g) throws SlickException { float centerX = 800/2; float centerY = 600/2; g.translate(centerX, centerY); g.translate(-player.playerX, -player.playerY); gen.render(g); player.render(g); } playerX = 800 /2 - sprite.getWidth(); playerY = 600 /2 - sprite.getHeight(); I update the player position on keydown by .2f * delta Picture to help with explanation i92.photobucket.com/albums/l22/occ31191/Untitled-4.png

    Read the article

  • Problem with virtual mouse click

    - by Alex
    Hi. I have a program that simulates mouse click. Code is something like this: [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo); private const int MOUSEEVENTF_LEFTDOWN = 0x02; private const int MOUSEEVENTF_LEFTUP = 0x04; public static void DoMouseClick(int x, int y) { Cursor.Position = new Point(x, y); mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, x, y, 0, 0); } This code works perfectly. For example I call this function every 30 minutes. But if I press WINKEY+L (Windows is locked) only cursor is moved but not press occurs. Any ideas?

    Read the article

  • C# - Moving a control to the mouse's position

    - by APShredder
    Hello everybody. I am trying to get a control to follow the cursor when the user clicks and drag the control. The problem is that 1.) the control doesn't go to the mouse's position, and 2.) the control flickers and flies all over the place. I've tried a few different methods of doing this, but all so far have failed. I've tried: protected override void OnMouseDown(MouseEventArgs e) { while (e.Button == System.Windows.Forms.MouseButtons.Left) { this.Location = e.Location; } } and protected override void OnMouseMove(MouseEventArgs e) { while (e.Button == System.Windows.Forms.MouseButtons.Left) { this.Location = e.Location; } } but neither of these work. Any help is appreciated, and thanks in advance!

    Read the article

  • Find which MFC child window would receive a mouse click

    - by tfinniga
    So, I have a plugin to an MFC program. I'm using a mouse event hook (from SetWindowsHookEx) to capture clicks. The host application can have any number of (possibly overlapping) child windows open, but I only want to intercept clicks in a particular child window. Is there a way to figure out in the hook proc which of the child windows would process the click? I guess it's something like enumerate all child windows, looking at Z-order, but I'm very unfamiliar with the MFC/Win32 libraries, and I'm not able to find any good discussion about how to enumerate all children and calculate which is topmost.

    Read the article

  • Mouse move and thread

    - by bsebi
    When I move the mouse over the window, the program runs much faster (cc. 3 times). This is a real time webcam .Net/Mono application running on a MacBook. On Windows works perfect. Is this maybe a power saving function of the laptop? The code: Thread t = new Thread(Foo); t.Priority = ThreadPriority.Highest; // I've tried without priority too, doesn't matter t.Start(); ... void Foo() { while (true) { ++k; // then write k to the window somehow } }

    Read the article

  • Mouse stops working after changing function

    - by heyohletsgo
    I'm making a console board game on c++, and i've been able to make the mouse work in the first function, the menu one, however, when i get to the getmove function and need to click on a house, it simply doesn't work.. Can anyone help? This is the class with the mouse. #include <cstdlib> #include <iostream> #include <process.h> #include <windows.h> #include <time.h> #include <stdio.h> using namespace std; void Game(); int Chu(); int rato(int &row, int &col) { HANDLE hIn; hIn = GetStdHandle(STD_INPUT_HANDLE); bool Continue = TRUE; INPUT_RECORD InRec; DWORD NumRead; HWND window = GetConsoleWindow(); POINT cursorPos; RECT wpos; int x = 0; int y = 0; //cout << hIn << endl; FlushConsoleInputBuffer(hIn); while (Continue) { ReadConsoleInput(hIn, &InRec, 1, &NumRead); switch (InRec.EventType) { case MOUSE_EVENT: if (GetAsyncKeyState(VK_LBUTTON)) { cout << "RATO"<<endl; GetWindowRect(window, &wpos); GetCursorPos(&cursorPos); cursorPos.x -= wpos.left; cursorPos.y -= wpos.top; x = (cursorPos.x - 5) / 16; y = (cursorPos.y - 25) / 24; cout << x << " " << y << endl; row = x; col = y; return row; } else if (GetAsyncKeyState(VK_RBUTTON)){ GetWindowRect(window, &wpos); GetCursorPos(&cursorPos); cursorPos.x -= wpos.left; cursorPos.y -= wpos.top; x = (cursorPos.x - 5) / 16; y = (cursorPos.y - 25) / 24; cout << x << " " << y << endl; row = x; col = y; return row; } break; } } } int main() { cout << "\n\n\n click on the stars" << endl; cout << " \n\n\n *******" << endl; int z = 0; int x = 0; int y = 0; int xo = 0; switch (rato(x,y)) { case 1: Game(); break; case 2: Game(); break; case 3: Game(); break; case 4: rato(x, y); break; case 5: rato(x, y); break; case 6: Game(); break; case 7: Game(); break; case 8: Game(); break; case 9: Game(); break; default: cout << "click again"; break; } return 0; } void Game() { int x = 0; int y = 0; int i = 0; cout << "GAME" << endl; do{ i++; rato(x, y); } while (i <= 2); Chu(); } int Chu() { int x = 0; int y = 0; int a = 0; int b = 0; int xo = 0; int yo = 0; cout << "\ click on the stars" << endl; HANDLE hConsole; hConsole = GetStdHandle(STD_OUTPUT_HANDLE); do{ xo = rato(x, y); if (0 <= xo && xo <= 5) { a = 1;} else cout << "CLICK AGAIN" << endl; } while (xo!=0); cout << a; return a; system("PAUSE"); }

    Read the article

  • Image rotate to mouse using Jquery and CSS

    - by James
    I have a compass image and am trying to get the needle to follow the mouse around the page, exactly how the images are rotated in the following demo but without having to shift and click. I'm having trouble breaking down that code however, so any help would be most appreciated. Thanks in advance. http://www.elated.com/res/File/articles/development/javascript/jquery/smooth-rotatable-images-css3-jquery/ The images are simply wrapped in a div <div id="content"> <img id="compass" src="compass.png"/> <img id="needle" src="needle.png"/> </div>

    Read the article

  • ergonomics: what's better; trackball, ergonomic mouse or some other pointing device (a-la touchscree

    - by mauriciopastrana
    So I bit into the hype and recently purchased an apple wireless keyboard and that evil bar-of-soap thing apple makes for a mouse. Couple of hundred dollars later and this is where I begin to worry about RSI. Go figure. Don't get me wrong, this apple mouse is genius and looks pretty as hell, but my right wrist feels tired after a full day's worth of work, so i'm thinking of switching. Anyone out there use a trackball? is this worse? should I get a super-ergonomic mouse instead? I've seen mouse-trackball combos but am not sold, they still elicit the same end-finger behaviour detrimental for RSI, right? I also have a wrist-rest mousepad, but couldn't find one suitable for my keyboard. I've even considered having a small touchscreen where the mousepad should go, no mouse (or alternatively, a usb trackpad). Just looking for ideas, is the trackball better than the mouse? /mp

    Read the article

  • Can I control the mouse cursor from within R?

    - by Bernd Meyer
    Is it possible, to control the mouse pointer from the R console? I have something like this in mind: move_mouse(x_pos=100,y_pos=200) # move the mouse pointer to position (100,200) mouse_left_button_down # simulate a press of the left button move_mouse(x_pos=120,y_pos=250) # move mouse to select something mose_release_left_button # release the pressed button In MATLAB, something like this is possible with the following code import java.awt.Robot; mouse = Robot; mouse.mouseMove(0, 0); mouse.mouseMove(100, 200); Is something similar possible for the keybord? E.g. simulate keybord events?

    Read the article

  • Xlib mouse events and ButtonPressMask

    - by Trilly Campanelino
    I have written a simple program which will report key press and release events for a particular window. In my case, it is mostly the terminal since I invoke the program from the terminal. I am able to get the key press and release events taking place in the terminal window (I have used XSelectInput() with KeyPressMask and KeyReleaseMask on the terminal) but the same is not working with ButtonPress and ButtonRelease. Not just these, but any events related to the mouse are not being reported. Any idea why this is happening? #include #include #include #include #include #include int main() { Display *display = XOpenDisplay(NULL); KeySym k; int revert_to; Window window; XEvent event; XGetInputFocus(display, &window, &revert_to); XSelectInput(display, window, KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask); while(1) { XNextEvent(display,&event); switch (event.type) { case KeyPress : printf("Key Pressed\n"); break; case KeyRelease : printf("Key Released\n"); break; case ButtonPress : printf("Button Pressed\n"); break; case ButtonRelease : printf("Button Released\n"); break; case EnterNotify : printf("Enter\n"); break; } } XCloseDisplay(display); return 0; }

    Read the article

  • Simple Mouse Move Event in F# with Winforms

    - by MarkPearl
    This evening I had the pleasure of reading one of ThomasP’s blog posts on first class events. It was an excellent read, and I thought I would make a brief derivative of his post to explore some of the basics. In Thomas’s post he has a form with an ellipse on it that when he clicks on the ellipse it pops up a message box with the button clicked… awesome. Something that got me on the post though was the code similar to the one below… // React to Mouse Move events on the form let evtMessages = frm.MouseMove |> Event.map (fun mi -> mi.Location.ToString()) |> Event.map (sprintf "Hey, you clicked on the ellipse.\nUsing: %s") |> Event.add (MessageBox.Show >> ignore) The MessageBox is a function with a string passed into it. What if I wanted to rather change a mutable value holder instead, how would the syntax go for that? Immediately the thought came to me of anonymous functions. I’ve used them before to do something like this… let HelloPerson personName = "Hello " + personName |> fun(x) -> Console.WriteLine(x) So using the same approach I adapted the event code to instead of showing a Message Box with a string passed in to it, to rather change the forms header. |> Event.map (sprintf "Your mouse position is %s") |> Event.add(fun(x) -> frm.Text <- x) Okay… it looks a bit weird with the –> x <- syntax, but makes sense and works… The next thing I wanted to do was change Thomas’s code sample from having an ellipse, and reacting to the position of the mouse and click, to rather trigger the event whenever the mouse moved. This simple involved removing some filtering code. Finally I wanted the code to work as a FSharp Project without having to run through the F# interactive. To achieve this I just needed to find out how to trigger the window event loop. This can be achieved with the code below… // Program eventloop while frm.Created do Application.DoEvents()   So lets look at the complete code sample… #light open System open System.Drawing open System.Windows.Forms // Create the main form let frm = new Form(ClientSize=Size(600,400)) // React to Mouse Move events on the form let evtMessages = frm.MouseMove |> Event.map (fun mi -> mi.Location.ToString()) |> Event.map (sprintf "Your mouse position is %s") |> Event.add(fun(x) -> frm.Text <- x) // Show the form frm.Show() // Program eventloop while frm.Created do Application.DoEvents()

    Read the article

  • Mouse buttons and all keyboard buttons except alt and super randomly stops working

    - by bobbaluba
    A couple of times lately, unity appears to not accept button presses from neither the mouse or the keyboard. This happens after a random amount of time, usually a couple of hours, or right after boot. The weird thing is: I can still move the mouse around. I can press alt to get the unity menu thingy (but i can't type anything in it) I can press super to show/hide the unity search. None of the applications seem to get the input Ive tried connecting a second mouse, same issue I can press ctrl+alt+f1 to drop to a shell tty The shell works fine Now, this is definitely a bug, probably in unity(?), but it's hard to search for when I don't know what's causing it. Is there something I can do to debug? I've found some people that appears to be having the same problem with the mouse only, but most of the time, their questions are unanswered or closed for being too specific. What would be a good strategy to fix this? Should I report it as a bug?

    Read the article

  • Mouse Cursor Freezes Randomly with Intel GMA 950

    - by Harry
    I'm using Ubuntu 10.10 its installed using Wubi, dual boot with Windows. It's fresh install. Randomly mouse cursor freezes and cant click anything on the screen. I can move mouse but cant click. "It causes when select a text something" So I'm using keyboard to to reboot system. Then it back to normal after reboot. Tried with unplugging-plugging mouse don't work. PC: Asus laptop with Intel GMA 950 graphic card. A4 tech optical mouse. Ubuntu 10.10 completely updated and upgraded. How can I get around this?

    Read the article

  • SDL mouse wheel not picking up

    - by Chris
    Running Ubuntu 11.04, SDL 1.2 trying to pickup mouse wheel up/down movement with this (stripped down) code: int main( int argc, char **argv ) { SDL_MouseButtonEvent *mousebutton = NULL; while ( !done ) { if(mousebutton != NULL && mousebutton->button == SDL_BUTTON_LEFT) yrot += 0.75f; else if(mousebutton != NULL && mousebutton->button == SDL_BUTTON_RIGHT) yrot -= 0.75f; else if(mousebutton != NULL && mousebutton->button == SDL_BUTTON_WHEELUP){ xrot += 0.75f; }else if(mousebutton != NULL && mousebutton->button == SDL_BUTTON_WHEELDOWN){ xrot -= 0.75f; } while ( SDL_PollEvent( &event ) ) { switch( event.type ) { case SDL_MOUSEBUTTONDOWN: mousebutton = &event.button; break; case SDL_MOUSEBUTTONUP: mousebutton = NULL; break; default: break; } } } return 0; } strange thing is, scrolling with the mouse button does nothing, but if I hold down a mouse button or two and then move the mouse it hits the SDL_BUTTON_WHEEL code occasionally. This honestly reeks of a pointer issue, which would make sense since I've been spoiled with C# for the past couple years, but I am just not seeing it. How do i correctly find mouse scroll events in SDL?

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >