onepad: Cleanup in a few places.

This commit is contained in:
Shanoah Alkire 2019-04-28 01:36:43 -07:00
parent 6a202c9b5f
commit b270c1bb67
14 changed files with 84 additions and 24 deletions

View File

@ -1,3 +1,22 @@
/*
* PCSX2 Dev Team
* Copyright (C) 2015
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "GamePad.h"
#ifdef SDL_BUILD
#include "SDL/joystick.h"

View File

@ -1,7 +1,27 @@
/*
* PCSX2 Dev Team
* Copyright (C) 2015
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#pragma once
#include "onepad.h"
#include "controller.h"
#ifdef SDL_BUILD
#include <SDL.h>
#endif

View File

@ -24,8 +24,11 @@
* Pragmatically, event handing's going in here too.
*/
#if defined(__unix__)
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#endif
#include "keyboard.h"
#ifdef _WIN32
@ -240,7 +243,10 @@ bool PollX11KeyboardMouseEvent(u32 &pkey)
LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static bool lbutton = false, rbutton = false;
g_key_status.keyboard_state_acces(cpad);
for (int pad = 0; pad < GAMEPAD_NUMBER; ++pad)
{
g_key_status.keyboard_state_acces(pad);
}
switch (msg) {
case WM_KEYDOWN:

View File

@ -20,6 +20,7 @@
*/
#include "state_management.h"
#include "GamePad.h"
// Typical packet response on the bus
static const u8 ConfigExit[7] = {0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -28,9 +28,10 @@
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/slider.h>
#include "GamePad.h"
#include "keyboard.h"
#include "onepad.h"
#include "../GamePad.h"
#include "../keyboard.h"
#include "../onepad.h"
class GamepadConfiguration : public wxDialog
{

View File

@ -28,9 +28,10 @@
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/slider.h>
#include "GamePad.h"
#include "keyboard.h"
#include "onepad.h"
#include "../GamePad.h"
#include "../keyboard.h"
#include "../onepad.h"
class JoystickConfiguration : public wxDialog
{

View File

@ -35,9 +35,9 @@
#include <string>
#include <sstream>
#include "GamePad.h"
#include "keyboard.h"
#include "onepad.h"
#include "../GamePad.h"
#include "../keyboard.h"
#include "../onepad.h"
#include "opPanel.h"
#include "GamepadConfiguration.h"

View File

@ -23,8 +23,10 @@
#include "onepad.h"
#include "controller.h"
#ifdef SDL_BUILD
#include <SDL.h>
#define HAT_UP SDL_HAT_UP
#define HAT_DOWN SDL_HAT_DOWN
#define HAT_RIGHT SDL_HAT_RIGHT

View File

@ -26,9 +26,10 @@
#include <SDL_haptic.h>
#endif
#include "GamePad.h"
#include "onepad.h"
#include "controller.h"
#include "../GamePad.h"
#include "../onepad.h"
#include "../controller.h"
#define NB_EFFECT 2 // Don't use more than two, ps2 only has one for big motor and one for small(like most systems)
// holds all joystick info
class JoystickInfo : GamePad

View File

@ -24,9 +24,12 @@
* Pragmatically, event handing's going in here too.
*/
#include "keyboard.h"
#if defined(__unix__)
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "keyboard.h"
#endif
#ifdef _WIN32
char *KeysymToChar(int keysym)
@ -276,7 +279,10 @@ bool PollX11KeyboardMouseEvent(u32 &pkey)
LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static bool lbutton = false, rbutton = false;
key_status->keyboard_state_acces(cpad);
for (int pad = 0; pad < GAMEPAD_NUMBER; ++pad)
{
key_status->keyboard_state_acces(pad);
}
switch (msg)
{

View File

@ -20,6 +20,7 @@
*/
#include "state_management.h"
#include "GamePad.h"
// Typical packet response on the bus
static const u8 ConfigExit[7] = {0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -28,9 +28,10 @@
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/slider.h>
#include "GamePad.h"
#include "keyboard.h"
#include "onepad.h"
#include "../GamePad.h"
#include "../keyboard.h"
#include "../onepad.h"
class GamepadConfiguration : public wxDialog
{

View File

@ -28,9 +28,10 @@
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/slider.h>
#include "GamePad.h"
#include "keyboard.h"
#include "onepad.h"
#include "../GamePad.h"
#include "../keyboard.h"
#include "../onepad.h"
class JoystickConfiguration : public wxDialog
{

View File

@ -35,9 +35,9 @@
#include <string>
#include <sstream>
#include "GamePad.h"
#include "keyboard.h"
#include "onepad.h"
#include "../GamePad.h"
#include "../keyboard.h"
#include "../onepad.h"
#include "opPanel.h"
#include "GamepadConfiguration.h"