mirror of https://github.com/PCSX2/pcsx2.git
onepad: Cleanup in a few places.
This commit is contained in:
parent
6a202c9b5f
commit
b270c1bb67
|
@ -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"
|
#include "GamePad.h"
|
||||||
#ifdef SDL_BUILD
|
#ifdef SDL_BUILD
|
||||||
#include "SDL/joystick.h"
|
#include "SDL/joystick.h"
|
||||||
|
|
|
@ -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
|
#pragma once
|
||||||
|
|
||||||
#include "onepad.h"
|
#include "onepad.h"
|
||||||
#include "controller.h"
|
#include "controller.h"
|
||||||
|
|
||||||
#ifdef SDL_BUILD
|
#ifdef SDL_BUILD
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -24,8 +24,11 @@
|
||||||
* Pragmatically, event handing's going in here too.
|
* Pragmatically, event handing's going in here too.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(__unix__)
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include <gdk/gdkkeysyms.h>
|
#include <gdk/gdkkeysyms.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "keyboard.h"
|
#include "keyboard.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -240,7 +243,10 @@ bool PollX11KeyboardMouseEvent(u32 &pkey)
|
||||||
LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
static bool lbutton = false, rbutton = false;
|
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) {
|
switch (msg) {
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "state_management.h"
|
#include "state_management.h"
|
||||||
|
#include "GamePad.h"
|
||||||
|
|
||||||
// Typical packet response on the bus
|
// Typical packet response on the bus
|
||||||
static const u8 ConfigExit[7] = {0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
static const u8 ConfigExit[7] = {0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
|
|
|
@ -28,9 +28,10 @@
|
||||||
#include <wx/button.h>
|
#include <wx/button.h>
|
||||||
#include <wx/checkbox.h>
|
#include <wx/checkbox.h>
|
||||||
#include <wx/slider.h>
|
#include <wx/slider.h>
|
||||||
#include "GamePad.h"
|
|
||||||
#include "keyboard.h"
|
#include "../GamePad.h"
|
||||||
#include "onepad.h"
|
#include "../keyboard.h"
|
||||||
|
#include "../onepad.h"
|
||||||
|
|
||||||
class GamepadConfiguration : public wxDialog
|
class GamepadConfiguration : public wxDialog
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,9 +28,10 @@
|
||||||
#include <wx/button.h>
|
#include <wx/button.h>
|
||||||
#include <wx/checkbox.h>
|
#include <wx/checkbox.h>
|
||||||
#include <wx/slider.h>
|
#include <wx/slider.h>
|
||||||
#include "GamePad.h"
|
|
||||||
#include "keyboard.h"
|
#include "../GamePad.h"
|
||||||
#include "onepad.h"
|
#include "../keyboard.h"
|
||||||
|
#include "../onepad.h"
|
||||||
|
|
||||||
class JoystickConfiguration : public wxDialog
|
class JoystickConfiguration : public wxDialog
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,9 +35,9 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#include "GamePad.h"
|
#include "../GamePad.h"
|
||||||
#include "keyboard.h"
|
#include "../keyboard.h"
|
||||||
#include "onepad.h"
|
#include "../onepad.h"
|
||||||
#include "opPanel.h"
|
#include "opPanel.h"
|
||||||
|
|
||||||
#include "GamepadConfiguration.h"
|
#include "GamepadConfiguration.h"
|
||||||
|
|
|
@ -23,8 +23,10 @@
|
||||||
|
|
||||||
#include "onepad.h"
|
#include "onepad.h"
|
||||||
#include "controller.h"
|
#include "controller.h"
|
||||||
|
|
||||||
#ifdef SDL_BUILD
|
#ifdef SDL_BUILD
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
|
||||||
#define HAT_UP SDL_HAT_UP
|
#define HAT_UP SDL_HAT_UP
|
||||||
#define HAT_DOWN SDL_HAT_DOWN
|
#define HAT_DOWN SDL_HAT_DOWN
|
||||||
#define HAT_RIGHT SDL_HAT_RIGHT
|
#define HAT_RIGHT SDL_HAT_RIGHT
|
||||||
|
|
|
@ -26,9 +26,10 @@
|
||||||
#include <SDL_haptic.h>
|
#include <SDL_haptic.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "GamePad.h"
|
#include "../GamePad.h"
|
||||||
#include "onepad.h"
|
#include "../onepad.h"
|
||||||
#include "controller.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)
|
#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
|
// holds all joystick info
|
||||||
class JoystickInfo : GamePad
|
class JoystickInfo : GamePad
|
||||||
|
|
|
@ -24,9 +24,12 @@
|
||||||
* Pragmatically, event handing's going in here too.
|
* Pragmatically, event handing's going in here too.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "keyboard.h"
|
||||||
|
|
||||||
|
#if defined(__unix__)
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include <gdk/gdkkeysyms.h>
|
#include <gdk/gdkkeysyms.h>
|
||||||
#include "keyboard.h"
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
char *KeysymToChar(int keysym)
|
char *KeysymToChar(int keysym)
|
||||||
|
@ -276,7 +279,10 @@ bool PollX11KeyboardMouseEvent(u32 &pkey)
|
||||||
LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
static bool lbutton = false, rbutton = false;
|
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)
|
switch (msg)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "state_management.h"
|
#include "state_management.h"
|
||||||
|
#include "GamePad.h"
|
||||||
|
|
||||||
// Typical packet response on the bus
|
// Typical packet response on the bus
|
||||||
static const u8 ConfigExit[7] = {0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
static const u8 ConfigExit[7] = {0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
|
|
|
@ -28,9 +28,10 @@
|
||||||
#include <wx/button.h>
|
#include <wx/button.h>
|
||||||
#include <wx/checkbox.h>
|
#include <wx/checkbox.h>
|
||||||
#include <wx/slider.h>
|
#include <wx/slider.h>
|
||||||
#include "GamePad.h"
|
|
||||||
#include "keyboard.h"
|
#include "../GamePad.h"
|
||||||
#include "onepad.h"
|
#include "../keyboard.h"
|
||||||
|
#include "../onepad.h"
|
||||||
|
|
||||||
class GamepadConfiguration : public wxDialog
|
class GamepadConfiguration : public wxDialog
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,9 +28,10 @@
|
||||||
#include <wx/button.h>
|
#include <wx/button.h>
|
||||||
#include <wx/checkbox.h>
|
#include <wx/checkbox.h>
|
||||||
#include <wx/slider.h>
|
#include <wx/slider.h>
|
||||||
#include "GamePad.h"
|
|
||||||
#include "keyboard.h"
|
#include "../GamePad.h"
|
||||||
#include "onepad.h"
|
#include "../keyboard.h"
|
||||||
|
#include "../onepad.h"
|
||||||
|
|
||||||
class JoystickConfiguration : public wxDialog
|
class JoystickConfiguration : public wxDialog
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,9 +35,9 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#include "GamePad.h"
|
#include "../GamePad.h"
|
||||||
#include "keyboard.h"
|
#include "../keyboard.h"
|
||||||
#include "onepad.h"
|
#include "../onepad.h"
|
||||||
#include "opPanel.h"
|
#include "opPanel.h"
|
||||||
|
|
||||||
#include "GamepadConfiguration.h"
|
#include "GamepadConfiguration.h"
|
||||||
|
|
Loading…
Reference in New Issue