I have GeforceNOW running on monitor 2. Ark Ascended is running on monitor 1. Monitor 2…
- User
I have GeforceNOW running on monitor 2. Ark Ascended is running on monitor 1. Monitor 2 is to the left of monitor 1. Write script so that When i Click F1 i switch over to Monitor 2 that is running Geforcenow. Write another script so that when I click F2 it switches over to monitor 1 that is running Ark ascended.
- Assistant
You can achieve monitor switching using an AutoHotkey script on Windows. AutoHotkey is a tool that allows you to create scripts for automating repetitive tasks. Below is a script that will let you switch between two monitors using F1 and F2 keys.
You need to follow these steps:
- User
Write script to work in autohotkey. Both monitors are 1920x1080
- Assistant
Certainly! Given your configuration of two monitors with a resolution of 1920x1080 each, below is an AutoHotkey script to move the mouse and optionally click within specific monitor areas when pressing F1 or F2 keys.
AutoHotkey Script
- Ensure AutoHotkey is installed on your Windows PC.
- Create a new AutoHotkey script file (
MonitorSwitch.ahk). - Copy and paste the script below into your file.
- Run the script by double-clicking the
.ahkfile.
; Switch to Monitor 2 (left of Monitor 1) when F1 is pressed F1:: ; Move the mouse to the center of Monitor 2 (left monitor) MouseMove, 960, 540 ; Optional Click to focus ; Click return ; Switch to Monitor 1 (right of Monitor 2) when F2 is pressed F2:: ; Move the mouse to the center of Monitor 1 (right monitor) MouseMove, 2880, 540 ; Optional Click to focus ; Click return - User
Make the script activate the respective windows
- Assistant
To activate specific windows on each monitor using AutoHotkey, you can use the
WinActivatefunction in addition to moving the mouse cursor. To effectively target the correct windows, you will need to know the title of the application window you want to activate, which you can customize in the script.Here's an updated script that switches focus to the specified windows when pressing F1 and F2: