yes , there is sdl2 joystick event and also keyboard events, but is it possible to manipulate with gpio pins of my odroid xu4 with sdl2. I can do it by wiringpi library , but likewise is there any procedure to map my gpio pins so that it can be directly accessed by sdl2
Why do you need that? You can always manually check the pins in your main loop, no?
yes till now I have checked manually only,its just the curiosity, if I can use the default joystick_button functions to manipulate the gpio pins.
like using SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP , but instead of joystick I will be using some other push buttons.
I am just asking is it possible to do such things ??
Well I guess anything is possible if you have the time to look at the SDL’s source and modify it.
If the only thing that matters to you is to be able to use the same
code for processing these inputs as you use for controllers, you can
read the inputs in your main loop before your call to SDL_PollEvent,
build your own SDL_JoyButtonEvent based on the GPIO data and use
SDL_PeepEvents to add it to the event queue. It will then be delivered
as any other event. This way your game code does not need any special
handling for the GPIO inputs.
thank you !!