Skip to content

Instantly share code, notes, and snippets.

@Qyriad
Created August 13, 2023 07:10
Show Gist options
  • Select an option

  • Save Qyriad/e11bdf585c4438fd4fcee75fcccf25ed to your computer and use it in GitHub Desktop.

Select an option

Save Qyriad/e11bdf585c4438fd4fcee75fcccf25ed to your computer and use it in GitHub Desktop.
Make controller/gamepad input work in Windows 11 Task View
#Requires AutoHotkey v2.0
; Joy1 is A
#HotIf WinActive("Task View")
Joy1::Send "{Enter}"
; Joy2 is B
#HotIf WinActive("Task View")
Joy2::Send "{Escape}"
; Joy3 is X
#HotIf WinActive("Task View")
Joy3::Send "{Tab}"
while true
{
WinWaitActive("Task View")
key := ""
while true
{
dpad := GetKeyState("JoyPOV")
switch dpad
{
case -1:
; Key was released. Send it and reset state.
Send key
key := ""
case 9000:
key := "{Right}"
case 27000:
key := "{Left}"
case 0:
key := "{Up}"
case 18000:
key := "{Down}"
}
}
sleep 10
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment