You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to disable the dependency on nuklear_gamepad? I have my own controller implementation, that I'd like to get the input for nuklear_console from.
The text was updated successfully, but these errors were encountered:
Been curious about easing the dependency too. But in the mean time, you are able to implement your own custom gamepad input source. Something like this....
#defineNK_GAMEPAD_NONE#defineNK_GAMEPAD_IMPLEMENTATION#include"nuklear_gamepad.h"voidcustom_gamepad_update(structnk_gamepads*gamepads, void*user_data) {
// Indicate that the left button is down for gamepad 0nk_gamepad_button(gamepads, 0, NK_GAMEPAD_BUTTON_LEFT, nk_true);
}
intmain() {
structnk_gamepad_input_sourceinput_source= {
.update=&custom_gamepad_update
};
structnk_gamepadsgamepads;
nk_gamepad_init_with_source(&gamepads, ctx, input_source);
nk_console_set_gamepads(console, &gamepads);
}
Which platform are you using? I'd love to add more options for input sources to ease integrations.
I'm using SDL2 as a base, but I have my own event loop for it, and a custom key->action remapping system so people can bind multiple keys and devices to the same action, among other things. I noticed that nuklear_console responds to the keyboard inputs in my loop, so I'm guessing if I just have my joystick handler send NK_KEY_UP/DOWN/LEFT/RIGHT inputs, I'll be set?
Also, thanks for replying, I appreciate it. I've been trying to get help with Nuklear itself in the main Nuklear repo, but nobody seems to reply there, making me feel like I'm up a creek without a paddle. This gives me some hope, though.
Is there a way to disable the dependency on nuklear_gamepad? I have my own controller implementation, that I'd like to get the input for nuklear_console from.
The text was updated successfully, but these errors were encountered: