Keyboard Shortcut to Move Mouse Cursor to Current Window

8

3

Under X Windows it is possible to move mouse cursor using shift+Num Lock and the numeric keypad as described in this wikipedia page. However, when you have two monitors running resolution of 3360x1050 moving cursor this way is rather slow. I am wondering if there is a way to quickly move mouse cursor anywhere inside of the active window.

A usage scenario is:

  1. Alt+tab to switch from "Window A" to "Window B" with both on two different monitor and both are visible. The mouse cursor stays in "Window A"
  2. Press some keyboard shortcut to send mouse cursor to "Window B"

Please let me know if there's some keyboard shortcut like this for any windows manager, bbkeys, etc.

I found that I can use something similar to

xdotool mousemove x y

to move cursor to a specific location. Thus, I create a script to do exactly that and map keys in my windows manager to call the script.

YMan Yen

Posted 2011-10-28T15:36:27.460

Reputation:

Answers

3

Alt+F7 does this for me in GNOME environment.

Aditya Patawari

Posted 2011-10-28T15:36:27.460

Reputation: 253

I use Alt + F7, Enter. You need to press Enter or Esc to end the "move the window" function. – pabouk – 2015-06-11T21:41:46.003

0

windows 10 when using extended screen. I find the easiest way to get the cursor back to screen A is to switch the mouse off and on again(unplug mouse USB and re-plug if wired). Possibly works when using 2 screens as well but never tried it! andy

andy james

Posted 2011-10-28T15:36:27.460

Reputation: 1

Hi, Andy, and welcome to Super User! Thanks for offering your advice - although I must say that disconnecting and reconnecting your mouse is likely not a good solution to this problem, as it would likely take more time and be more tedious to do what you've suggested than it would be for the user to continue using their computer as-is. Please make sure you've read the question in its entirety before you post an answer. – Sam Forbis – 2020-02-17T20:31:24.307