Skip to content
The Chat Archive
Human-written demonstration (OpenAssistant volunteers)· OpenAssistant (human-written) OpenAssistant Conversations (oasst2)

I want to make an autohotkey script that does two things: 1. use QRes to change the…

In OpenAssistant data, “assistant” turns were written by human volunteers as demonstrations. They are not model outputs.
  1. User

    I want to make an autohotkey script that does two things:

    1. use QRes to change the resolution to 2560x1440@60hz
    2. When I press the right side windows key, it should input as left side alt key
    3. When I press left side alt key, it should input as left side windows key

    It should do this as long as the program is running

  2. Assistant

    Sure, I can help you with that.

    Here's an AutoHotkey script that should do what you're asking for:

    #Persistent
    
    ; set the resolution to 2560x1440@60hz using QRes
    RunWait, qres.exe /x:2560 /y:1440 /r:60 /xV
    
    ; map right Windows key to left Alt and left Alt key to left Windows key
    RWin::LAlt
    LAlt::LWin
    

    This script sets itself as a persistent process (#Persistent) to keep running in the background as long as the script is running. It then uses the RunWait command to execute QRes with the desired resolution settings.

    Finally, it uses the :: hotstring syntax to map the right Windows key (RWin) to the left Alt key (LAlt), and the left Alt key (LAlt) to the left Windows key (LWin).

    Save this script as a .ahk file and run it using AutoHotkey. The script will continue to run in the background until you close it or exit AutoHotkey. Keep in mind that you need to have QRes installed on your machine.

    Is there anything else I can assist you with?

  3. User

    That's an awesome script. Can you {modify the script so that when I press a particular key combination of RWin or LAlt, it tiles my windows for me}? Please include rationale for your AHK code designs.

  4. Assistant

    Sure, here's a modified version of the script that will tile your windows when you press a specific key combination involving either RWin or LAlt:

    #Persistent

    ; set the resolution to 2560x1440@60hz using QRes RunWait, qres.exe /x:2560 /y:1440 /r:60 /xV

    ; map right Windows key to left Alt and left Alt key to left Windows key RWin::LAlt LAlt::LWin

    ; define hotkeys for window tiling !^1::WinMove, A,, 0, 0, 1280, 720 !^2::WinMove, A,, 1280, 0, 1280, 720 !^3::WinMove, A,, 0, 720, 1280, 720 !^4::WinMove, A,, 1280, 720, 1280, 720

    This version of the script uses the same resolution-setting and key-mapping commands as before.

    In addition, it defines new hotkeys for tiling your windows when you press a specific key combination. The hotkeys use the !^ syntax, which represents the Alt and Ctrl keys, respectively. The numbers after the combination represent the position on the screen where the window should be moved to. For example, pressing Alt+Ctrl+1 will move the current window to the top-left quadrant of the screen.

    The WinMove command is used to move the active window to the specified coordinates on the screen. The coordinates are specified as follows: x-coordinate, y-coordinate, width, and height. In this case, we're moving the window to one of four possible locations on a 2560x1440 screen.

    Feel free to modify the hotkey combinations and window positions to suit your preferences. And, as always, be sure to save the script as a .ahk file and run it using AutoHotkey.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.