Skip to content
TheChatArchiveThe Chat Archive
gpt-4o-2024-08-06· OpenAIAi2 WildChat-4.8M (AI2)

Edit the script so that F7 work on monitor two that is running Geforce NOW

  1. User

    Edit the script so that F7 work on monitor two that is running Geforce NOW

  2. Assistant

    To ensure that the F7 key works to trigger actions specifically in an application running on the second monitor, you need to customize how your operating system is handling keyboard inputs across multiple monitors. Here's a general approach to setting up a script for this scenario using AutoHotkey, a popular scripting language for Windows. This script assumes you want F7 to perform a specific action, such as switching focus to the GeForce NOW window on a second monitor or sending a particular command to it.

    Below is a sample AutoHotkey script to achieve this:

    1. Install AutoHotkey: If you haven't already, download and install AutoHotkey from AutoHotkey's website.

    2. Create a Script:

      • Open Notepad or any text editor.
      • Copy and paste the following script:
    ; This script listens for F7 and performs actions on a specific window
    SetTitleMatchMode, 2  ; Allows partial matching of window titles
    
    F7::
    {
        ; Identify the GeForce NOW window by its title (or part of it)
        WinGet, id, list, GeForce NOW
    
        if (id > 0) {
            ; Assuming only one instance, activate the GeForce NOW window
            if WinExist("ahk_id " . id1)
            {
                WinActivate, ahk_id %id1%
                ; Perform additional actions here if needed
                ; Send some keystrokes to the active window (example)
                ; Send, {Your_Keystroke_Sequence}
    
                ; Option to move the window to the second monitor if necessary
                ; Retrieve monitor dimensions
                SysGet, MonitorCount, MonitorCount
                if (MonitorCount > 1) {
                    SysGet, Monitor2, Monitor, 2
                    WinMove, ahk_id %id1%, , Monitor2Left, Monitor2Top
                }
            }
        }
    }
    return
    
    1. Customizing the Script:

      • Ensure that GeForce NOW matches part of the window title. Adjust this if the application window title is different.
      • If you need to send specific keystrokes to the GeForce NOW window, replace Your_Keystroke_Sequence with the desired key sequence.
    2. Run Your Script:

      • Save your script with an .ahk extension, e.g., GeforceNowF7.ahk.
      • Double-click the file to run it. It will appear in your system tray and will start monitoring for the F7 key.
    3. Confirm Functionality:

      • Press F7 and ensure that the GeForce NOW window on the second monitor gets focus or that your desired action is performed.

    This script is basic and serves as a starting point. Depending on your setup, you might need to adjust window titles or move commands to fit your environment.