mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
nJoy: Enabled keyboard input (only for buttons so far) through wxWidgets in the main application. It only works when you render to the main window.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1706 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -31,6 +31,18 @@
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Issues
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
The StrangeHack in ConfigAdvanced.cpp doesn't work in Linux, it still wont resize the
|
||||
window correctly. So currently in Linux you have to have advanced controls enabled when
|
||||
you open the window to see them.
|
||||
|
||||
////////////////////////*/
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Variables guide
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@ -164,7 +176,7 @@ void GetDllInfo(PLUGIN_INFO* _PluginInfo)
|
||||
// Call config dialog
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void DllConfig(HWND _hParent)
|
||||
{
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (SDL_Init(SDL_INIT_JOYSTICK ) < 0)
|
||||
{
|
||||
@ -348,6 +360,22 @@ void PAD_Shutdown()
|
||||
}
|
||||
|
||||
|
||||
// Set buttons status from wxWidgets in the main application
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void PAD_Input(u8 _Key, u8 _UpDown)
|
||||
{
|
||||
// Check if the keys are interesting, and then update it
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
for(int j = CTL_L_SHOULDER; j <= CTL_START; j++)
|
||||
{
|
||||
if (joysticks[i].buttons[j] == _Key)
|
||||
{ joystate[i].buttons[j] = _UpDown; break; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set PAD status. This is called from SerialInterface_Devices.cpp
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus)
|
||||
@ -590,7 +618,9 @@ unsigned int PAD_GetAttachedPads()
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Read current joystick status
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
The value joystate[].buttons[] is first the number of the assigned joupad button
|
||||
then it becomes 0 (no pressed) or 1 (pressed) */
|
||||
|
||||
// Read buttons status. Called from GetJoyState().
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@ -640,4 +670,4 @@ void GetJoyState(int controller)
|
||||
joystate[controller].dpad2[CTL_D_PAD_RIGHT] = SDL_JoystickGetButton(joystate[controller].joy, joysticks[controller].dpad2[CTL_D_PAD_RIGHT]);
|
||||
}
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
Reference in New Issue
Block a user