[Windows] X-Guide - my Guide button tool
#1
Introduction
I recently made my own HTPC with the goal to fully control it using only an xbox360 game controller.
When i started with XBMC it looked quite well and was easy to use - just like a gaming console.
The only problem i had was after launched an application/game/emulator from XBMC.
Launching another application from XBMC was no problem, but closing it to return to XBMC did not work.
I then searched for a solution and found tools allowing you to use the xbox 360 guide button to send an alt+F4
or Esc or launch a program. This was very close to what i wanted but not close enough.
Having an alt+F4 sent sometimes closed XBMC itself and Esc did not work for every application i wanted to use.
So now after writing my own Application to use the guide button i want to share it with you guys in case you want to
do the same things with it as i do.

What it does
1. When XBMC is not started all you have to do it hold the guide button for 1 second, then it will rumble shortly and then
XBMC is started.

2. When XBMC is started and another window is in the foreground just hold the guide button for 1 second, then it will rumble shortly
and then the process this window belongs to is killed.


How to install
This is easy. It is just a plain exe file. Once it is launched it will not have any window or taskbar symbol.
The Application has a Tray icon which you can use to close it.
To have it launched on windows startup just put it in your autostart folder and you are fine.


More technical/in depth explanation - Geeks only
What the application does is when it starts it looks in the registiry (read only access) for the key "HKEY_CURRENT_USER\Software\XBMC" and reads the
installation path of XBMC. This is used to launch XBMC when it is not started. Since i did not find a good location to get the name of the xbmc.exe the program
always assumes that the executable of xbmc is called xbmc.exe. After it looked up the XBMC installation path it checks if there really is an xbmc.exe in this folder,
if not the function to launch XBMC is disabled.
Now for the functions that are executed in a loop (repeated until the program is closed). The program always checks for the input of 4 controllers. If a controller is not found then
it is skipped. If it finds the guide button is pressed on a controller then it will remember the time it was pressed and checks again until the first press of the button was 1 second ago and
the button is still pressed. If so then the program checks if XBMC is running. If it is not running then it rumbles for 100 milliseconds at maximum intensity on both rumble motors
and then launches XBMC.
If XBMC is running then it checks which window currently has the focus and gets the processID from it. After that it compares
the processID of the window with XBMC and if the window is not XBMC it rumbles for 100 milliseconds at maximum intensity on both rumble motors and then it kills the process.


Download locations
http://uploaded.net/file/98cbg0sp
http://www.share-online.biz/dl/7UHGJR6NSD3P


P.S.
The program is still very new, i started it yesterday evening and finished it this morning. But from what i can say
it works with wired and wireless controllers and with windows 7 and 8. I do not plan to heavily develop new features for this but
if i encounter a bug i will fix it and upload it so you can stay up to date.


Update - Version 1.0.3 - Many Thanks to 3dhubiflieger who inspired me to do these Changes.
- XGuide now has a Notification Icon with reight click function to either close XGuide or open the Setup Window
- New option to set up the time until the GuideButton reacts.
- When a Parameter is changed the Change is written to an ini file in the Same Firectory as XGuide.exe

Update - Version 1.0.2
- when a second or third or fourth controller pressed the guide button then they did not rumble -> fixed
- Now steam (steam.exe) will be ignored/not closed

Update - Version 1.0.1
- Now xGuide can only be launched once
- Now command prompts (cmd.exe) will be ignored/not closed
Reply
#2
Hey man, the Idea was also mine ! I will test your Version and give you some feedback soon. Its cool to find someone with the same goal ! I am also writing on a Tool with Guidebutton support since January. The problems to come back to XBMC are solved. My tool has also features like XBMC Launcher ! I would be happy if you post a comment on my Englisch Thread ! Wink In which language did you programmed this tool ? You wrote that the motors rumble ! How Did you programming this ?


This Forum:
http://forum.xbmc.org/showthread.php?tid...bmcwatcher

German Forum:
http://www.xbmcnerds.com/index.php?page=...2&pageNo=1
Reply
#3
Hi !

I wrote it in Delphi, i program with Delphi at work so it was faster for me using it. To use rumble i used the xInput function XInputSetState to set the vibration on on both motors and deactivate it with XInputSetState after 100 milliseconds. I just read about your program and i can see you are even going further then i do by closing and restating xbmc. I think your approach will give a higher framerate on some games and i am sure you put a lot of effort into it. I will check it out and write my opinion in your thread :-)

Oh and thanks for testng!
Reply
#4
"I think your approach will give a higher framerate on some games..." The Problem is that it wont work in Win 8.
I have problems with acces rights to work correctly.

"...To use rumble i used the xInput function XInputSetState to set the vibration on on both motors and deactivate it with XInputSetState after 100 milliseconds." Thanks for the information, I will put this in my Program in a future Version..

I just tested your Program. It is just a small exe, not too big like other Programs. The Program runs fine and is not so buggy like mine in 1st Versions. It starts XBMC when i press the Guidebutton. And it closes all Foregroundwindows when XBMC is activated. Do you send a maximized message to the XBMChandle when XBMC is starting up.. ?
Now the Problem...I cant see a ProgramIcon in Vista 64 bit to exit your Program. So I need to use the Taskmanager !
Can you fix this ? A Popup Menu to exit the Program and to set the timer in ms for the Button like mine would be very good !
Reply
#5
Hi!

First of all: Thanks for testing, it is very appreciated Smile

You are right i launch the xbmc window maximised, at least it should. Regarding the missing close function i have to say that i personally
did not need it since i have the tool running on windows start and when windows shuts down the tool is also closed.
But the idea sounds nice. I think i can Make an icon in the notification area that opens a menu on right click.
In the menu you can then change some basic settings.

It will take a bit though until i am done with that. I am also still not sure if there is enough interest in the program itself to justify further development of new features.....
But we will see. Again thanks for your feedback, i will implement it as soon as i can Nod


UPDATE: I have implemented the Changes to the program. The new Version can be downloaded from the links above
Reply
#6
Just wanted to let you know this is a fantastic little program and works perfectly on Windows 7.
If you're still developing, maybe you could add a double-click on the guide button to pop up some sort of customizable menu (Run / Alt-Tab / System Processes / Turn Off / User-defined) that you cycle through with the controller.
Reply
#7
Does this work with Windows 10 and the Xbox One controller?

I started the program but nothing happens when I hold the guide button...

I am using Kodi Isengard
Reply

Logout Mark Read Team Forum Stats Members Help
[Windows] X-Guide - my Guide button tool0