#InstallKeybdHook

#IfWinActive ahk_class XBMC

; send enter instead of mouse click on fullscreen
LButton::
  ; WinGet, minmax, minmax, A
  Send {enter}
return

; Play / Pause (space)
Home::
  Send {Space}
return

; Volume Down
SC12E::
  Send -
return

; Volume Up
SC130::
  Send {+}
return

; Stop
Mbutton::
  Send {x}
return

;Info
f3::
  Send {i}
return

;Sub Menu
f4::
  Send {c}
return

; Home -> Back
RButton::
  Send {Backspace}
return

; Minimize
f2::
  Send {Alt Down}{Tab}{Alt Up}
return

#IfWinActive ahk_class TaskSwitcherWnd

LButton::
  Send {enter}{alt}
return

RButton:: ;Home::
  Send {Escape}
return

#IfWinActive

; Open Alt + Tab menu
f1::
  Send {Ctrl down}{Alt down}{Tab down}{Tab up}{Alt up}{Ctrl up}
return
