Any pad plugin to exit emulator from controller (hold select + press start)???
#1
Title says it all: Any pad plugin to exit emulator from controller (hold select + press start)???

^^That is the button combination I would like to use to shut down PCSX2! 

I really don't care what pad plugin I need to use to accomplish the end result even if I have to buy another software...!!!

Any suggestion on how to achieve this?

Is there any way to do this with LilyPad 0.12.0 or any other plugin??
Reply

Sponsored links

#2
For got to mention, I am using Xbox one Controllers
Reply
#3
You can probably do it with some autohotkey script but I don't have an xbox controller to try it

Code:
JoystickNumber = 0
if JoystickNumber <= 0
{
    Loop 16  ; Query each joystick number to find out which ones exist.
    {
        GetKeyState, JoyName, %A_Index%JoyName
        if JoyName <>
        {
            JoystickNumber = %A_Index%
            break
        }
    }
    if JoystickNumber <= 0
    {
        MsgBox The system does not appear to have any joysticks.
        ExitApp
    }
}

#SingleInstance
SetFormat, float, 03  ; Omit decimal point from axis position percentages.
GetKeyState, joy_buttons, %JoystickNumber%JoyButtons
GetKeyState, joy_name, %JoystickNumber%JoyName
GetKeyState, joy_info, %JoystickNumber%JoyInfo
Loop
{
    buttons_down =
    Loop, %joy_buttons%
    {
        GetKeyState, joy%a_index%, %JoystickNumber%joy%a_index%
        if joy%a_index% = D
            buttons_down = %buttons_down%%a_space%%a_index%
    }
    GetKeyState, joyx, %JoystickNumber%JoyX
    axis_info = X%joyx%
    GetKeyState, joyy, %JoystickNumber%JoyY
    axis_info = %axis_info%%a_space%%a_space%Y%joyy%
    IfInString, joy_info, Z
    {
        GetKeyState, joyz, %JoystickNumber%JoyZ
        axis_info = %axis_info%%a_space%%a_space%Z%joyz%
    }
    IfInString, joy_info, R
    {
        GetKeyState, joyr, %JoystickNumber%JoyR
        axis_info = %axis_info%%a_space%%a_space%R%joyr%
    }
    IfInString, joy_info, U
    {
        GetKeyState, joyu, %JoystickNumber%JoyU
        axis_info = %axis_info%%a_space%%a_space%U%joyu%
    }
    IfInString, joy_info, V
    {
        GetKeyState, joyv, %JoystickNumber%JoyV
        axis_info = %axis_info%%a_space%%a_space%V%joyv%
    }
    IfInString, joy_info, P
    {
        GetKeyState, joyp, %JoystickNumber%JoyPOV
        axis_info = %axis_info%%a_space%%a_space%POV%joyp%
    }
    ToolTip, %joy_name% (#%JoystickNumber%):`n%axis_info%`nButtons Down: %buttons_down%`n`n(right-click the tray icon to exit)
    Sleep, 100
}
return
I have no idea if this works with xinput controllers but if it works,I'll do this
1.Create the script(it's a text file with ahk extension)and run it with the program Autohotkey
2.When the script is running,pressing a button(it will probably not work with the triggers)will display a tooltip with the button name
3.In my case(DInput gamepad)the name for the select button is Joy9(I think or it was the other way around)and for start is Joy10
4.Create an new script(it's a text file with ahk extension)that look for example something like this(there are other methods too but I can't test them)

Code:
~Joy10::
If GetKeyState("Joy9")
Process,Close,pcsx2.exe
Return

What the code above mean is,when the Start button is pressed,autohotkey will check if the Select button is also pressed and if it is,it will try to close a process named pcsx2.exe
Reply
#4
(02-13-2017, 12:25 AM)vsub Wrote: You can probably do it with some autohotkey script but I don't have an xbox controller to try it

Code:
JoystickNumber = 0
if JoystickNumber <= 0
{
    Loop 16  ; Query each joystick number to find out which ones exist.
    {
        GetKeyState, JoyName, %A_Index%JoyName
        if JoyName <>
        {
            JoystickNumber = %A_Index%
            break
        }
    }
    if JoystickNumber <= 0
    {
        MsgBox The system does not appear to have any joysticks.
        ExitApp
    }
}

#SingleInstance
SetFormat, float, 03  ; Omit decimal point from axis position percentages.
GetKeyState, joy_buttons, %JoystickNumber%JoyButtons
GetKeyState, joy_name, %JoystickNumber%JoyName
GetKeyState, joy_info, %JoystickNumber%JoyInfo
Loop
{
    buttons_down =
    Loop, %joy_buttons%
    {
        GetKeyState, joy%a_index%, %JoystickNumber%joy%a_index%
        if joy%a_index% = D
            buttons_down = %buttons_down%%a_space%%a_index%
    }
    GetKeyState, joyx, %JoystickNumber%JoyX
    axis_info = X%joyx%
    GetKeyState, joyy, %JoystickNumber%JoyY
    axis_info = %axis_info%%a_space%%a_space%Y%joyy%
    IfInString, joy_info, Z
    {
        GetKeyState, joyz, %JoystickNumber%JoyZ
        axis_info = %axis_info%%a_space%%a_space%Z%joyz%
    }
    IfInString, joy_info, R
    {
        GetKeyState, joyr, %JoystickNumber%JoyR
        axis_info = %axis_info%%a_space%%a_space%R%joyr%
    }
    IfInString, joy_info, U
    {
        GetKeyState, joyu, %JoystickNumber%JoyU
        axis_info = %axis_info%%a_space%%a_space%U%joyu%
    }
    IfInString, joy_info, V
    {
        GetKeyState, joyv, %JoystickNumber%JoyV
        axis_info = %axis_info%%a_space%%a_space%V%joyv%
    }
    IfInString, joy_info, P
    {
        GetKeyState, joyp, %JoystickNumber%JoyPOV
        axis_info = %axis_info%%a_space%%a_space%POV%joyp%
    }
    ToolTip, %joy_name% (#%JoystickNumber%):`n%axis_info%`nButtons Down: %buttons_down%`n`n(right-click the tray icon to exit)
    Sleep, 100
}
return
I have no idea if this works with xinput controllers but if it works,I'll do this
1.Create the script(it's a text file with ahk extension)and run it with the program Autohotkey
2.When the script is running,pressing a button(it will probably not work with the triggers)will display a tooltip with the button name
3.In my case(DInput gamepad)the name for the select button is Joy9(I think or it was the other way around)and for start is Joy10
4.Create an new script(it's a text file with ahk extension)that look for example something like this(there are other methods too but I can't test them)

Code:
~Joy10::
If GetKeyState("Joy9")
Process,Close,pcsx2.exe
Return

What the code above mean is,when the Start button is pressed,autohotkey will check if the Select button is also pressed and if it is,it will try to close a process named pcsx2.exe

That sounds awesome!!!!
Reply
#5
I've haven't had good luck with AHK scripts to work in the past, but that probably has more to do with trying AHK to work with the frontend, HyperSpin, versus the actual emulator.

I have since moved onto LaunchBox which has been awesome!

I'll definitely give your approach a shot, only problem is I don't really know where to start but if you give me instructions and/or screenshots, I should be able to pull it off with your help!
Reply
#6
I'll like your idea!!! Just let me know how to configure pcsx2 with AHK scripts all the way from the top!!! I want it done by the books! Jk jk
Reply
#7
I told you what to do to get the button name and how to make a script that uses those buttons.
The example script that I show you above don't care if you run pcsx2 from frontend,he just checks if certain button is pressed while pressing another and executes a function if both buttons are pressed

The only problem is if Autohotkey can work with wireless xinput controller.
I'm not infront of my pc but even if I was with my DInput wired gamapad,that script will work and closes pcsx2 if I press start while pressing and holding select first

I can't explain it simplier than that
Reply
#8
(02-13-2017, 03:04 AM)vsub Wrote: I told you what to do to get the button name and how to make a script that uses those buttons.
The example script that I show you above don't care if you run pcsx2 from frontend,he just checks if certain button is pressed while pressing another and executes a function if both buttons are pressed

The only problem is if Autohotkey can work with wireless xinput controller.
I'm not infront of my pc but even if I was with my DInput wired gamapad,that script will work and closes pcsx2 if I press start while pressing and holding select first

I can't explain it simplier than that

@vsub You probably know PCSX2 better than anyone else and I appreciate when someone, like yourself, comes along with not only advice & solutions, but expertise and who are active in the forum community.

Your solution should solve my problem, however, what I struggle with is finding, lack there of, documentation/instructions to get me on the path to make it happen. I am fairly new to PCSX2 and still learning my way around it and need help with the basics such as: (file pathways/where to put what in file directories/GUI configuration, etc.) <-and try to find knowledge where ever published (YouTube, written, etc...) .  If you would not mind, passing along any knowledge to me as far as which files to edit/create & file pathways, you would not only help me achieve my goal, but also help the entire community & noobs like me with solving problems with new solutions as such. 

I'm currently running a recently downloaded pcsx2 developer version 1.5 less than 2 days old if this is relevant to the topic. 

I have been able to configure pcsx2 to work properly with GPU using GUI.

Since this ^^AHK more than likely requires editing/creating file in who knows which file pathways? <-I find this very intimidating compared to GUI & need all the help I can get. I was not able to find anything in the GUI as far as AHK goes....
Reply
#9
1.Install AHK
2.Create a new autohotkey script(it's in the same menu where you create new text document/folder)
3.Edit the new file with notepad and place the first script to see if AHK can detect your gamepad when pressing buttons and I told you what to do after that

The script can be placed anywhere and it will work the same way
You can also add above the hotkey

RunWait,the full path to the launcher including the file name

That way you can start the frontend from the script and add that hotkey feature and the script will be closed when you exit the frontend

What I'm telling you to do has nothing to do with how much you know pcsx2
Reply
#10
Trying to avoid third party applications as much as possible, but the controller exit hotkey is exactly what brought me to the forum too. The main concern is that other applications I use do support hotkey mapping internally to those applications and I wouldn't want a third party application hijacking the preferred input for built in functionality in those applications. The only thought I can add to support such a feature request is that a common emulation setup is a standalone HTPC with only a controller and maybe remote control attached wirelessly, exiting pcsx2 to return to a controller browsable emulator front end or media browser without keyboard or mouse, and without hijacking a button that other applications would use for their own purposes, would be a requirement in those cases. Of course this would all assume somebody actually cared to create that type of feature, and I'm sure there are plenty of more important tasks at hand.
Reply




Users browsing this thread: 1 Guest(s)