openMSX
JoystickId.hh
Go to the documentation of this file.
1#ifndef JOYSTICK_ID_HH
2#define JOYSTICK_ID_HH
3
4#include "strCat.hh"
5
6namespace openmsx {
7
8// openMSX specific joystick numbering,
9// different from SDL joystick device index and
10// different from SDL joystick instance ID.
12public:
13 explicit JoystickId(unsigned id_) : id(id_) {}
14 [[nodiscard]] unsigned raw() const { return id; }
15 [[nodiscard]] bool operator==(const JoystickId&) const = default;
16 [[nodiscard]] std::string str() const { return strCat("joy", id + 1); }
17
18private:
19 unsigned id;
20};
21
22} // namespace openmsx
23
24#endif
std::string str() const
Definition JoystickId.hh:16
unsigned raw() const
Definition JoystickId.hh:14
JoystickId(unsigned id_)
Definition JoystickId.hh:13
bool operator==(const JoystickId &) const =default
This file implemented 3 utility functions:
Definition Autofire.cc:11
std::string strCat()
Definition strCat.hh:703