Move mouse cursor to next monitor

Hi,

It would be great to add a new action "Move Mouse Cursor to Next Monitor" under "Other Mouse Actions", similar to how we already have a "Move Window to Next Monitor".

Thanks!

Just checking.. Any updates here? I don't think it should be too difficult to implement. Otherwise I'd have to look for alternative options. Thanks!

1 Like

Move mouse to position.... should do what you're looking for.

Thanks for the reply @Caliguvara
Unfortunately that doesn't quite do what I want. What I need is an action that moves the mouse cursor like this:
Monitor 1 -> Monitor 2 -> Monitor 3 -> Monitor 1 -> etc.
I.e. not just a one-time movement to a specific position, but continuously cycling between monitors.

1 Like

Haven't used an external monitor in years, but with negative values in the position relative to the Botton right corner I think you should be able to achieve this :thinking: Then working with additional actions to get the other "jumps".

You can use the "Run Real Javascript action" and add some logic there to achieve this. Here is an example:

The example code (just very quickly hacked together, you'll need to adapt the coordinates)


(async() => {
let action =  {
    "BTTPredefinedActionType" : 153,
    "BTTMoveMouseToPosition" : undefined,
    "BTTMoveMouseRelative" : "0",
};


let currentMonitor = await callBTT('get_number_variable', {variable_name: 'currentMon'});

if(!currentMonitor) {
  currentMonitor = 0;

}

if(currentMonitor == 0) {
  action.BTTMoveMouseToPosition = "{100, 100}";
  await callBTT('trigger_action', {json: JSON.stringify(action)});
  currentMonitor = 1;
  returnToBTT('0');

}else
if(currentMonitor == 1) {
  action.BTTMoveMouseToPosition = "{200, 200}";
  await callBTT('trigger_action', {json: JSON.stringify(action)});
    currentMonitor = 2;
	returnToBTT('1');


}else
if(currentMonitor == 2) {
  action.BTTMoveMouseToPosition = "{300, 300}";
  await callBTT('trigger_action', {json: JSON.stringify(action)});
    currentMonitor = 0;
returnToBTT('2');

}
  await callBTT('set_number_variable', {variable_name: 'currentMon', to: currentMonitor});


})()



I'm here looking for the same exact thing—an action called "Move Mouse to Next Display and Center" and "Move Mouse to Previous Display and Center". Bonus points to BTT if they allow for wrapping too where continual presses of the shortcut key would cycle through the displays (e.g. on far right display would wrap to far left display).

@Andreas_Hegenberg I tried using your script but it just cycles the mouse position diagonally on my main display. Here's a GIF of what I'm seeing on my end: https://geigel.com/shares/Cdoc9i3

Further, my displays are setup this way in case that has any bearing on the script: https://geigel.com/shares/IlPcO7o

Any pointers and/or updates to the script achieve my desired functionality described above?

Thanks in advance!

AG3

Interested in this option too. For many of us, recording mouse position is not really viable because our monitor setup/arrangement will change between work and home.

I too would be interested in such an action.

Thanks.