Two notable changes: 1. Eliminates the joystick setup from SDLmain, allowing the mapper's QueryJoysticks() function to be the sole setup and configuration point for both the SDL Joystick subsystem and DOSBox's internal configuration of the joysticks. 2. SDLmain's event loop previously perform some joystick- specific timing and always called the Mapper's UpdateJoysticks function; neither of which are needed if the user has disabled joystick support or if joysticks aren't physically present. This update now make this entire process conditional on both of the latter (which is set by the Mapper's QueryJoysticks).
49 lines
1.7 KiB
C++
49 lines
1.7 KiB
C++
/*
|
|
* Copyright (C) 2002-2020 The DOSBox Team
|
|
*
|
|
* 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.
|
|
*/
|
|
|
|
#ifndef DOSBOX_MAPPER_H
|
|
#define DOSBOX_MAPPER_H
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include "setup.h"
|
|
#include "types.h"
|
|
|
|
enum MapKeys {
|
|
MK_f1,MK_f2,MK_f3,MK_f4,MK_f5,MK_f6,MK_f7,MK_f8,MK_f9,MK_f10,MK_f11,MK_f12,
|
|
MK_return,MK_kpminus,MK_scrolllock,MK_printscreen,MK_pause,MK_home
|
|
|
|
};
|
|
|
|
typedef void (MAPPER_Handler)(bool pressed);
|
|
void MAPPER_AddHandler(MAPPER_Handler * handler,MapKeys key,Bitu mods,char const * const eventname,char const * const buttonname);
|
|
void MAPPER_BindKeys();
|
|
void MAPPER_StartUp(Section * sec);
|
|
void MAPPER_Run(bool pressed);
|
|
void MAPPER_DisplayUI();
|
|
void MAPPER_LosingFocus();
|
|
bool MAPPER_IsUsingJoysticks();
|
|
std::vector<std::string> MAPPER_GetEventNames(const std::string &prefix);
|
|
void MAPPER_AutoType(std::vector<std::string> &sequence,
|
|
const uint32_t wait_ms,
|
|
const uint32_t pacing_ms);
|
|
|
|
#define MMOD1 0x1
|
|
#define MMOD2 0x2
|
|
|
|
#endif
|