mirror of
https://github.com/Lorenzooone/cc3dsfs.git
synced 2026-09-15 20:15:25 -05:00
Add basic infrastructure for JoyStick support
This commit is contained in:
@@ -312,6 +312,10 @@ void WindowScreen::poll() {
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case sf::Event::JoystickButtonPressed:
|
||||
break;
|
||||
case sf::Event::JoystickMoved:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -508,7 +512,12 @@ void WindowScreen::poll_window() {
|
||||
sf::Event event;
|
||||
this->events_access->lock();
|
||||
while(this->m_win.pollEvent(event)) {
|
||||
events_queue.emplace(event.type, event.key.code, event.text.unicode);
|
||||
int joystickId = event.joystickConnect.joystickId;
|
||||
if(event.type == sf::Event::JoystickButtonPressed)
|
||||
joystickId = event.joystickButton.joystickId;
|
||||
else if(event.type == sf::Event::JoystickMoved)
|
||||
joystickId = event.joystickMove.joystickId;
|
||||
events_queue.emplace(event.type, event.key.code, event.text.unicode, joystickId, event.joystickButton.button, event.joystickMove.axis, event.joystickMove.position);
|
||||
}
|
||||
this->events_access->unlock();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user