Homebrew Question SDL Event Polling

  • Thread starter Thread starter Fleetscut
  • Start date Start date
  • Views Views 1,317
  • Replies Replies 1

Fleetscut

New Member
Newbie
Joined
Jul 2, 2018
Messages
3
Reaction score
2
Trophies
0
Age
46
XP
236
Country
Canada
Ive managed to put together a simple SDL app and can get images and colors to be displayed. The thing i am trying to figure out right now is how to look for controller events. Ive tried to check for various event types by putting some checks into the applet loop but it doesnt look like any of the bellow are getting triggered. Is there a special event type that needs to be checked for?

Code:
while (SDL_PollEvent(&event)) {
            switch(event.type) {
                case SDL_KEYDOWN:
                    printf("Keyboard button was pressed\n");
                case SDL_JOYBUTTONDOWN:
                    printf("Joystick button was pressed\n");
                case SDL_CONTROLLERBUTTONDOWN:
                    printf("Controller button was pressed\n");
            }
}

Ive managed to get the regular hid* functions to work for joycon input but was wondering how to get the SDL libraries to work.
 

Site & Scene News

Popular threads in this forum