Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions demo/allegro5/nuklear_allegro5.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,14 @@ nk_allegro5_handle_event(ALLEGRO_EVENT *ev)
} break;
case ALLEGRO_EVENT_MOUSE_BUTTON_DOWN:
case ALLEGRO_EVENT_MOUSE_BUTTON_UP: {
int button = NK_BUTTON_LEFT;
if (ev->mouse.button == 2) {
button = NK_BUTTON_RIGHT;
}
else if (ev->mouse.button == 3) {
button = NK_BUTTON_MIDDLE;
int button;
switch (ev->mouse.button) {
case 1: button = NK_BUTTON_LEFT; break;
case 2: button = NK_BUTTON_RIGHT; break;
case 3: button = NK_BUTTON_MIDDLE; break;
case 4: button = NK_BUTTON_X1; break;
case 5: button = NK_BUTTON_X2; break;
default: return 0;
}
nk_input_button(ctx, button, ev->mouse.x, ev->mouse.y, ev->type == ALLEGRO_EVENT_MOUSE_BUTTON_DOWN);
return 1;
Expand Down
35 changes: 35 additions & 0 deletions demo/common/overview.c
Original file line number Diff line number Diff line change
Expand Up @@ -1354,6 +1354,41 @@ overview(struct nk_context *ctx)
}
nk_tree_pop(ctx);
}

/* Input */
if (nk_tree_push(ctx, NK_TREE_TAB, "Input", NK_MINIMIZED))
{
const struct nk_input *in = &ctx->input;
static const char *button_names[NK_BUTTON_MAX] = {
"Left", "Middle", "Right", "Double Click", "X1", "X2"
};
int i;

/* Mouse Buttons*/
nk_layout_row_dynamic(ctx, 30, 1);
nk_label(ctx, "Mouse Buttons", NK_TEXT_LEFT);
nk_layout_row_dynamic(ctx, 20, 2);
for (i = 0; i < NK_BUTTON_MAX; i++) {
nk_label(ctx, button_names[i], NK_TEXT_LEFT);
if (nk_input_is_mouse_pressed(in, i))
nk_label(ctx, "Pressed", NK_TEXT_LEFT);
else if (nk_input_is_mouse_down(in, i))
nk_label(ctx, "Down", NK_TEXT_LEFT);
else if (nk_input_is_mouse_released(in, i))
nk_label(ctx, "Released", NK_TEXT_LEFT);
else
nk_label(ctx, "Up", NK_TEXT_LEFT);
Comment on lines +1373 to +1380
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of how Nuklear serves those events, it's almost impossible to see Pressed/Released appearing. I even had hard time to capture recording of this (because my display is 75Hz) and I haven't seen it ever appearing in some demos (not sure if that was a bug in specific demo or not)

Any ideas on improving this? My first one was to split Down/Up and Pressed/Released events into two columns, but I don't think this would help much anyway.

This can be fixed as follow up PR but maybe you see any quick solution now?

Copy link
Copy Markdown
Contributor Author

@RobLoach RobLoach Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true. Pressed is only displayed for 1 frame. Same with Released. Unsure of a good way to ensure that's clear without some timers and gross code. Maybe a follow up.

Copy link
Copy Markdown
Contributor

@sleeptightAnsiC sleeptightAnsiC Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably just split it and then make the text slowly fade away. This file already uses delta time in few places, but yea, it might become ugly.

I'll enter a task for it, right after this PR gets merged.

}

/* Mouse Wheel */
nk_layout_row_dynamic(ctx, 30, 1);
nk_label(ctx, "Mouse Wheel", NK_TEXT_LEFT);
nk_layout_row_dynamic(ctx, 20, 2);
nk_labelf(ctx, NK_TEXT_LEFT, "X: %.2f", in->mouse.scroll_delta.x);
nk_labelf(ctx, NK_TEXT_LEFT, "Y: %.2f", in->mouse.scroll_delta.y);
nk_tree_pop(ctx);
}

Comment thread
RobLoach marked this conversation as resolved.
if (disable_widgets)
nk_widget_disable_end(ctx);
}
Expand Down
24 changes: 24 additions & 0 deletions demo/d3d11/nuklear_d3d11.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,30 @@ nk_d3d11_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
ReleaseCapture();
return 1;

case WM_XBUTTONDOWN:
switch (GET_XBUTTON_WPARAM(wparam)) {
case XBUTTON1:
nk_input_button(&d3d11.ctx, NK_BUTTON_X1, (short)LOWORD(lparam), (short)HIWORD(lparam), 1);
break;
case XBUTTON2:
nk_input_button(&d3d11.ctx, NK_BUTTON_X2, (short)LOWORD(lparam), (short)HIWORD(lparam), 1);
break;
}
SetCapture(wnd);
return 1;

case WM_XBUTTONUP:
switch (GET_XBUTTON_WPARAM(wparam)) {
case XBUTTON1:
nk_input_button(&d3d11.ctx, NK_BUTTON_X1, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
break;
case XBUTTON2:
nk_input_button(&d3d11.ctx, NK_BUTTON_X2, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
break;
}
ReleaseCapture();
return 1;

case WM_MOUSEWHEEL:
nk_input_scroll(&d3d11.ctx, nk_vec2(0,(float)(short)HIWORD(wparam) / WHEEL_DELTA));
return 1;
Expand Down
24 changes: 24 additions & 0 deletions demo/d3d12/nuklear_d3d12.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,30 @@ nk_d3d12_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
ReleaseCapture();
return 1;

case WM_XBUTTONDOWN:
switch (GET_XBUTTON_WPARAM(wparam)) {
case XBUTTON1:
nk_input_button(&d3d12.ctx, NK_BUTTON_X1, (short)LOWORD(lparam), (short)HIWORD(lparam), 1);
break;
case XBUTTON2:
nk_input_button(&d3d12.ctx, NK_BUTTON_X2, (short)LOWORD(lparam), (short)HIWORD(lparam), 1);
break;
}
SetCapture(wnd);
return 1;

case WM_XBUTTONUP:
switch (GET_XBUTTON_WPARAM(wparam)) {
case XBUTTON1:
nk_input_button(&d3d12.ctx, NK_BUTTON_X1, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
break;
case XBUTTON2:
nk_input_button(&d3d12.ctx, NK_BUTTON_X2, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
break;
}
ReleaseCapture();
return 1;

case WM_MOUSEWHEEL:
nk_input_scroll(&d3d12.ctx, nk_vec2(0,(float)(short)HIWORD(wparam) / WHEEL_DELTA));
return 1;
Expand Down
24 changes: 24 additions & 0 deletions demo/d3d9/nuklear_d3d9.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,30 @@ nk_d3d9_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
ReleaseCapture();
return 1;

case WM_XBUTTONDOWN:
switch (GET_XBUTTON_WPARAM(wparam)) {
case XBUTTON1:
nk_input_button(&d3d9.ctx, NK_BUTTON_X1, (short)LOWORD(lparam), (short)HIWORD(lparam), 1);
break;
case XBUTTON2:
nk_input_button(&d3d9.ctx, NK_BUTTON_X2, (short)LOWORD(lparam), (short)HIWORD(lparam), 1);
break;
}
SetCapture(wnd);
return 1;

case WM_XBUTTONUP:
switch (GET_XBUTTON_WPARAM(wparam)) {
case XBUTTON1:
nk_input_button(&d3d9.ctx, NK_BUTTON_X1, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
break;
case XBUTTON2:
nk_input_button(&d3d9.ctx, NK_BUTTON_X2, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
break;
}
ReleaseCapture();
return 1;

case WM_MOUSEWHEEL:
nk_input_scroll(&d3d9.ctx, nk_vec2(0,(float)(short)HIWORD(wparam) / WHEEL_DELTA));
return 1;
Expand Down
24 changes: 24 additions & 0 deletions demo/gdi/nuklear_gdi.h
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,30 @@ nk_gdi_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
ReleaseCapture();
return 1;

case WM_XBUTTONDOWN:
switch (GET_XBUTTON_WPARAM(wparam)) {
case XBUTTON1:
nk_input_button(&gdi.ctx, NK_BUTTON_X1, (short)LOWORD(lparam), (short)HIWORD(lparam), 1);
break;
case XBUTTON2:
nk_input_button(&gdi.ctx, NK_BUTTON_X2, (short)LOWORD(lparam), (short)HIWORD(lparam), 1);
break;
}
SetCapture(wnd);
return 1;

case WM_XBUTTONUP:
switch (GET_XBUTTON_WPARAM(wparam)) {
case XBUTTON1:
nk_input_button(&gdi.ctx, NK_BUTTON_X1, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
break;
case XBUTTON2:
nk_input_button(&gdi.ctx, NK_BUTTON_X2, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
break;
}
ReleaseCapture();
return 1;

case WM_MOUSEWHEEL:
nk_input_scroll(&gdi.ctx, nk_vec2(0,(float)(short)HIWORD(wparam) / WHEEL_DELTA));
return 1;
Expand Down
24 changes: 24 additions & 0 deletions demo/gdi_native_nuklear/nuklear_gdi.h
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,30 @@ nk_gdi_handle_event(nk_gdi_ctx gdi, HWND wnd, UINT msg, WPARAM wparam, LPARAM lp
ReleaseCapture();
return 1;

case WM_XBUTTONDOWN:
switch (GET_XBUTTON_WPARAM(wparam)) {
case XBUTTON1:
nk_input_button(&gdi->ctx, NK_BUTTON_X1, (short)LOWORD(lparam), (short)HIWORD(lparam), 1);
break;
case XBUTTON2:
nk_input_button(&gdi->ctx, NK_BUTTON_X2, (short)LOWORD(lparam), (short)HIWORD(lparam), 1);
break;
}
SetCapture(wnd);
return 1;

case WM_XBUTTONUP:
switch (GET_XBUTTON_WPARAM(wparam)) {
case XBUTTON1:
nk_input_button(&gdi->ctx, NK_BUTTON_X1, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
break;
case XBUTTON2:
nk_input_button(&gdi->ctx, NK_BUTTON_X2, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
break;
}
ReleaseCapture();
return 1;

case WM_MOUSEWHEEL:
nk_input_scroll(&gdi->ctx, nk_vec2(0, (float)(short)HIWORD(wparam) / WHEEL_DELTA));
return 1;
Expand Down
24 changes: 24 additions & 0 deletions demo/gdip/nuklear_gdip.h
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,30 @@ nk_gdip_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
ReleaseCapture();
return 1;

case WM_XBUTTONDOWN:
switch (GET_XBUTTON_WPARAM(wparam)) {
case XBUTTON1:
nk_input_button(&gdip.ctx, NK_BUTTON_X1, (short)LOWORD(lparam), (short)HIWORD(lparam), 1);
break;
case XBUTTON2:
nk_input_button(&gdip.ctx, NK_BUTTON_X2, (short)LOWORD(lparam), (short)HIWORD(lparam), 1);
break;
}
SetCapture(wnd);
return 1;

case WM_XBUTTONUP:
switch (GET_XBUTTON_WPARAM(wparam)) {
case XBUTTON1:
nk_input_button(&gdip.ctx, NK_BUTTON_X1, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
break;
case XBUTTON2:
nk_input_button(&gdip.ctx, NK_BUTTON_X2, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
break;
}
ReleaseCapture();
return 1;

case WM_MOUSEWHEEL:
nk_input_scroll(&gdip.ctx, nk_vec2(0,(float)(short)HIWORD(wparam) / WHEEL_DELTA));
return 1;
Expand Down
2 changes: 2 additions & 0 deletions demo/glfw_opengl2/nuklear_glfw_gl2.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@ nk_glfw3_new_frame(void)
nk_input_button(ctx, NK_BUTTON_MIDDLE, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_MIDDLE) == GLFW_PRESS);
nk_input_button(ctx, NK_BUTTON_RIGHT, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_RIGHT) == GLFW_PRESS);
nk_input_button(ctx, NK_BUTTON_DOUBLE, (int)glfw.double_click_pos.x, (int)glfw.double_click_pos.y, glfw.is_double_click_down);
nk_input_button(ctx, NK_BUTTON_X1, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_4) == GLFW_PRESS);
nk_input_button(ctx, NK_BUTTON_X2, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_5) == GLFW_PRESS);
nk_input_scroll(ctx, glfw.scroll);
nk_input_end(&glfw.ctx);

Expand Down
2 changes: 2 additions & 0 deletions demo/glfw_opengl3/nuklear_glfw_gl3.h
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,8 @@ nk_glfw3_new_frame(struct nk_glfw* glfw)
nk_input_button(ctx, NK_BUTTON_MIDDLE, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_MIDDLE) == GLFW_PRESS);
nk_input_button(ctx, NK_BUTTON_RIGHT, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_RIGHT) == GLFW_PRESS);
nk_input_button(ctx, NK_BUTTON_DOUBLE, (int)glfw->double_click_pos.x, (int)glfw->double_click_pos.y, glfw->is_double_click_down);
nk_input_button(ctx, NK_BUTTON_X1, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_4) == GLFW_PRESS);
nk_input_button(ctx, NK_BUTTON_X2, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_5) == GLFW_PRESS);
nk_input_scroll(ctx, glfw->scroll);
nk_input_end(&glfw->ctx);

Expand Down
2 changes: 2 additions & 0 deletions demo/glfw_opengl4/nuklear_glfw_gl4.h
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,8 @@ nk_glfw3_new_frame(void)
nk_input_button(ctx, NK_BUTTON_MIDDLE, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_MIDDLE) == GLFW_PRESS);
nk_input_button(ctx, NK_BUTTON_RIGHT, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_RIGHT) == GLFW_PRESS);
nk_input_button(ctx, NK_BUTTON_DOUBLE, (int)glfw.double_click_pos.x, (int)glfw.double_click_pos.y, glfw.is_double_click_down);
nk_input_button(ctx, NK_BUTTON_X1, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_4) == GLFW_PRESS);
nk_input_button(ctx, NK_BUTTON_X2, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_5) == GLFW_PRESS);
nk_input_scroll(ctx, glfw.scroll);
nk_input_end(&glfw.ctx);

Expand Down
2 changes: 2 additions & 0 deletions demo/glfw_vulkan/nuklear_glfw_vulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,8 @@ NK_API void nk_glfw3_new_frame(void) {
GLFW_PRESS);
nk_input_button(ctx, NK_BUTTON_DOUBLE, (int)glfw.double_click_pos.x,
(int)glfw.double_click_pos.y, glfw.is_double_click_down);
nk_input_button(ctx, NK_BUTTON_X1, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_4) == GLFW_PRESS);
nk_input_button(ctx, NK_BUTTON_X2, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_5) == GLFW_PRESS);
nk_input_scroll(ctx, glfw.scroll);
nk_input_end(&glfw.ctx);

Expand Down
6 changes: 6 additions & 0 deletions demo/rawfb/sdl/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ static int sdl_button_to_nk(int button)
case SDL_BUTTON_RIGHT:
return NK_BUTTON_RIGHT;
break;
case SDL_BUTTON_X1:
return NK_BUTTON_X1;
break;
case SDL_BUTTON_X2:
return NK_BUTTON_X2;
break;

}
}
Expand Down
34 changes: 31 additions & 3 deletions demo/rawfb/wayland/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,42 @@ static void nk_wayland_pointer_button (void *data, struct wl_pointer *pointer, u
NK_UNUSED(serial);
NK_UNUSED(time);

if (button == 272){ //left mouse button
switch (button) {
case 272: // Left Mouse Button
if (state == WL_POINTER_BUTTON_STATE_PRESSED) {
// printf("nk_input_button x=%d, y=%d press: 1 \n", win->mouse_pointer_x, win->mouse_pointer_y);
nk_input_button(&(win->rawfb->ctx), NK_BUTTON_LEFT, win->mouse_pointer_x, win->mouse_pointer_y, 1);

} else if (state == WL_POINTER_BUTTON_STATE_RELEASED) {
nk_input_button(&(win->rawfb->ctx), NK_BUTTON_LEFT, win->mouse_pointer_x, win->mouse_pointer_y, 0);
}
break;
case 273: // Right Mouse Button
if (state == WL_POINTER_BUTTON_STATE_PRESSED) {
nk_input_button(&(win->rawfb->ctx), NK_BUTTON_RIGHT, win->mouse_pointer_x, win->mouse_pointer_y, 1);
} else if (state == WL_POINTER_BUTTON_STATE_RELEASED) {
nk_input_button(&(win->rawfb->ctx), NK_BUTTON_RIGHT, win->mouse_pointer_x, win->mouse_pointer_y, 0);
}
break;
case 274: // Middle Mouse Button
if (state == WL_POINTER_BUTTON_STATE_PRESSED) {
nk_input_button(&(win->rawfb->ctx), NK_BUTTON_MIDDLE, win->mouse_pointer_x, win->mouse_pointer_y, 1);
} else if (state == WL_POINTER_BUTTON_STATE_RELEASED) {
nk_input_button(&(win->rawfb->ctx), NK_BUTTON_MIDDLE, win->mouse_pointer_x, win->mouse_pointer_y, 0);
}
break;
case 275: // X1
if (state == WL_POINTER_BUTTON_STATE_PRESSED) {
nk_input_button(&(win->rawfb->ctx), NK_BUTTON_X1, win->mouse_pointer_x, win->mouse_pointer_y, 1);
} else if (state == WL_POINTER_BUTTON_STATE_RELEASED) {
nk_input_button(&(win->rawfb->ctx), NK_BUTTON_X1, win->mouse_pointer_x, win->mouse_pointer_y, 0);
}
break;
case 276: // X2
if (state == WL_POINTER_BUTTON_STATE_PRESSED) {
nk_input_button(&(win->rawfb->ctx), NK_BUTTON_X2, win->mouse_pointer_x, win->mouse_pointer_y, 1);
} else if (state == WL_POINTER_BUTTON_STATE_RELEASED) {
nk_input_button(&(win->rawfb->ctx), NK_BUTTON_X2, win->mouse_pointer_x, win->mouse_pointer_y, 0);
}
break;
}
}

Expand Down
4 changes: 4 additions & 0 deletions demo/rawfb/x11/nuklear_xlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ nk_xlib_handle_event(Display *dpy, int screen, Window win, XEvent *evt, struct r
nk_input_scroll(&rawfb->ctx, nk_vec2(0, 1.0f));
else if (evt->xbutton.button == Button5)
nk_input_scroll(&rawfb->ctx, nk_vec2(0, -1.0f));
else if (evt->xbutton.button == 8)
nk_input_button(&rawfb->ctx, NK_BUTTON_X1, x, y, down);
else if (evt->xbutton.button == 9)
nk_input_button(&rawfb->ctx, NK_BUTTON_X2, x, y, down);
else return 0;
return 1;
} else if (evt->type == MotionNotify) {
Expand Down
2 changes: 2 additions & 0 deletions demo/sdl3_renderer/nuklear_sdl3_renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,8 @@ nk_sdl_handle_event(struct nk_context* ctx, SDL_Event *evt)
break;
case SDL_BUTTON_MIDDLE: nk_input_button(ctx, NK_BUTTON_MIDDLE, x, y, down); break;
case SDL_BUTTON_RIGHT: nk_input_button(ctx, NK_BUTTON_RIGHT, x, y, down); break;
case SDL_BUTTON_X1: nk_input_button(ctx, NK_BUTTON_X1, x, y, down); break;
case SDL_BUTTON_X2: nk_input_button(ctx, NK_BUTTON_X2, x, y, down); break;
default:
return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions demo/sdl_opengl2/nuklear_sdl_gl2.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ nk_sdl_handle_event(SDL_Event *evt)
nk_input_button(ctx, NK_BUTTON_LEFT, x, y, down); break;
case SDL_BUTTON_MIDDLE: nk_input_button(ctx, NK_BUTTON_MIDDLE, x, y, down); break;
case SDL_BUTTON_RIGHT: nk_input_button(ctx, NK_BUTTON_RIGHT, x, y, down); break;
case SDL_BUTTON_X1: nk_input_button(ctx, NK_BUTTON_X1, x, y, down); break;
case SDL_BUTTON_X2: nk_input_button(ctx, NK_BUTTON_X2, x, y, down); break;
}
}
return 1;
Expand Down
2 changes: 2 additions & 0 deletions demo/sdl_opengl3/nuklear_sdl_gl3.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ nk_sdl_handle_event(SDL_Event *evt)
nk_input_button(ctx, NK_BUTTON_LEFT, x, y, down); break;
case SDL_BUTTON_MIDDLE: nk_input_button(ctx, NK_BUTTON_MIDDLE, x, y, down); break;
case SDL_BUTTON_RIGHT: nk_input_button(ctx, NK_BUTTON_RIGHT, x, y, down); break;
case SDL_BUTTON_X1: nk_input_button(ctx, NK_BUTTON_X1, x, y, down); break;
case SDL_BUTTON_X2: nk_input_button(ctx, NK_BUTTON_X2, x, y, down); break;
}
}
return 1;
Expand Down
2 changes: 2 additions & 0 deletions demo/sdl_opengles2/nuklear_sdl_gles2.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,8 @@ nk_sdl_handle_event(SDL_Event *evt)
nk_input_button(ctx, NK_BUTTON_LEFT, x, y, down); break;
case SDL_BUTTON_MIDDLE: nk_input_button(ctx, NK_BUTTON_MIDDLE, x, y, down); break;
case SDL_BUTTON_RIGHT: nk_input_button(ctx, NK_BUTTON_RIGHT, x, y, down); break;
case SDL_BUTTON_X1: nk_input_button(ctx, NK_BUTTON_X1, x, y, down); break;
case SDL_BUTTON_X2: nk_input_button(ctx, NK_BUTTON_X2, x, y, down); break;
}
}
return 1;
Expand Down
2 changes: 2 additions & 0 deletions demo/sdl_renderer/nuklear_sdl_renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@ nk_sdl_handle_event(SDL_Event *evt)
nk_input_button(ctx, NK_BUTTON_LEFT, x, y, down); break;
case SDL_BUTTON_MIDDLE: nk_input_button(ctx, NK_BUTTON_MIDDLE, x, y, down); break;
case SDL_BUTTON_RIGHT: nk_input_button(ctx, NK_BUTTON_RIGHT, x, y, down); break;
case SDL_BUTTON_X1: nk_input_button(ctx, NK_BUTTON_X1, x, y, down); break;
case SDL_BUTTON_X2: nk_input_button(ctx, NK_BUTTON_X2, x, y, down); break;
}
}
return 1;
Expand Down
Loading