Add few more members.
This commit is contained in:
@@ -63,7 +63,14 @@ bool jstick::Connected(int hwid) {
|
||||
return js_connected && js_handle == hwid;
|
||||
}
|
||||
|
||||
bool jstick::Connect(int hwid) {
|
||||
std::string jstick::GetDeviceName(int hwid) {
|
||||
char name_buf[128];
|
||||
if (ioctl(hwid, JSIOCGNAME(sizeof(name_buf)), name_buf) < 0)
|
||||
strncpy(name_buf, "Unknown", sizeof(name_buf));
|
||||
return std::string(name_buf);
|
||||
}
|
||||
|
||||
int jstick::Connect(int hwid) {
|
||||
if (js_connected) {
|
||||
std::cerr << "Joystick already connected! Support for multiple joysticks is in-progress!" << std::endl;
|
||||
return false;
|
||||
@@ -77,7 +84,7 @@ bool jstick::Connect(int hwid) {
|
||||
|
||||
js_connected = true;
|
||||
JoystickConnected.Invoke(js_handle);
|
||||
return true;
|
||||
return js_handle;
|
||||
}
|
||||
|
||||
bool jstick::Disconnect(int hwid) {
|
||||
|
Reference in New Issue
Block a user