Skip to content

Instantly share code, notes, and snippets.

@neozero
Last active December 6, 2017 23:55
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save neozero/0d8b77e1ea7124c478185c55462f2a07 to your computer and use it in GitHub Desktop.
Save neozero/0d8b77e1ea7124c478185c55462f2a07 to your computer and use it in GitHub Desktop.
Unhide Oculus Home window, enable keyboard and mouse input.
; Home Unhider
;
; Author: NeoZeroo
; www.emuvr.net
;
; Instructions:
;
; Just run it after Oculus Home is running, and it will show up.
; This doesn't keep running, it just unhides Home and exits instantly.
;
; You can maximize the window of even resize it at will.
; Don't try pressing Alt + Enter to make it fullscreen, as that
; will just make it invisible again.
;
; If you manually close this window, and not the desktop store window,
; it'll just reopen again hidden (DK2 users beware, don't forget it
; running forever, make sure to close the desktop window).
;
; Keyboard and mouse controls were already implemented on Oculus Home,
; it just did not have focus to receive any input from them.
; We're only unhiding the window.
;
; Left Click or Spacebar = A button (OK)
; Right Click or Esc = B button (Cancel)
; Arrows = D-Pad
; There's no keyboard key for the Xbox Guide button function.
;
; When opening a game, Home will gracefully pause and wait in the
; background as the new game window will be on top, and then unpause
; when the game exits.
;
; When pressing the Xbox Guide button, the Home window will take the
; front while showing the menu, and then will get to the back again
; as you dismiss the menu.
;
; Mouse and keyboard control still work in the menu.
#NoTrayIcon
SetBatchLines, -1
DetectHiddenWindows, On
found := false
WinGet, windowList, List, ahk_class UnityWndClass
Loop, % windowList
{
windowID := windowList%A_Index%
WinGet, processName, ProcessName, ahk_id %windowID%
WinGet, windowStyle, Style, ahk_id %windowID%
if(processName == "OculusVR.exe" && ((windowStyle & 0x10000000) == 0))
{
found := true
break
}
}
if(!found)
{
MsgBox, 0x10, Home Unhider, Oculus Home could not be detected.`nMake sure it is running on the HMD and try again.
ExitApp
}
WinSet, Style, +0x00010000, ahk_id %windowID% ;WS_MAXIMIZEBOX
WinSet, Style, +0x00040000, ahk_id %windowID% ;WS_SIZEBOX
WinSet, ExStyle, +0x00040000, ahk_id %windowID% ;WS_EX_APPWINDOW
WinSet, ExStyle, +0x02000000, ahk_id %windowID% ;WS_EX_COMPOSITED
WinSet, ExStyle, +0x00010000, ahk_id %windowID% ;WS_EX_CONTROLPARENT
WinSet, ExStyle, -0x08000000, ahk_id %windowID% ;WS_EX_NOACTIVATE
WinShow, ahk_id %windowID%
WinActivate, ahk_id %windowID%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment