Introduction
In this comprehensive guide, we will explore various pieces of software that can create additional "Keys" bound to application instances, and monitor/switch their use based on display layout changes. These tools can greatly enhance productivity and organization for users who frequently work with multiple applications and windows.
AutoHotkey
AutoHotkey is a powerful automation and scripting language for Windows. It allows users to create custom hotkeys, automate repetitive tasks, and interact with windows and applications programmatically. Using AutoHotkey, it is possible to create additional keys bound to application instances and switch between them based on display layout changes.
Example Script
The following example script demonstrates how to create a custom hotkey (Win + `) that lists all open windows and allows the user to switch between them based on their display layout:
#NoEnv
#SingleInstance, Force
#Persistent
Menu, MyWinList, Add, List Windows, ListWindows
Return
ListWindows:
WinGet, id, List
Loop, %id% {
IfWinExist, % "ahk_id " . id[A]
{
WinActivate, % "ahk_id " . id[A]
}
}
Return
Keypirinha
Keypirinha is a lightweight and highly customizable application launcher for Windows. It allows users to create custom actions, hotkeys, and triggers that can interact with applications and windows. Similar to AutoHotkey, Keypirinha can be used to create additional keys bound to application instances and switch between them based on display layout changes.
Example Configuration
The following example configuration demonstrates how to create a custom action that lists all open windows and allows the user to switch between them based on their display layout:
[main]
plugin_directories = %A_ScriptDir%\plugins
[ActionListWindows]
description = List Windows
category = Windows
invoke_method = run_plugin
plugin = ListWindowsPlugin
; ListWindowsPlugin.py
import keypirinha as kp
class ListWindowsPlugin(kp.Plugin):
def __init__(self):
super().__init__()
def on_run(self, event):
for window in kp.get_windows():
self.add_item(
title=window.title,
subtitle=window.exe,
arg=window.id,
icon=window.icon
)
return kp.Action.Next
In this article, we have explored two pieces of software, AutoHotkey and Keypirinha, that can create additional "Keys" bound to application instances and monitor/switch their use based on display layout changes. These tools can greatly enhance productivity and organization for users who frequently work with multiple applications and windows.