Lines Matching defs:mouse
677 /// mouse, key and text input states.
697 /// which resets internal state like delta mouse position and button transistions.
699 /// mouse motion, button and key pressed and released, text input and scrolling.
727 /// __nk_input_motion__ | Mirrors mouse cursor position
729 /// __nk_input_button__ | Mirrors mouse button state with either pressed or released
730 /// __nk_input_scroll__ | Mirrors mouse scroll values
780 /// mouse, previous mouse position and movement as well as key state transitions,
792 /// Mirrors current mouse position to nuklear
801 /// __x__ | Must hold an integer describing the current mouse cursor x-position
802 /// __y__ | Must hold an integer describing the current mouse cursor y-position
820 /// Mirrors the state of a specific mouse button to nuklear
830 /// __x__ | Must contain an integer describing mouse cursor x-position on click up/down
831 /// __y__ | Must contain an integer describing mouse cursor y-position on click up/down
836 /// Copies the last mouse scroll value to nuklear. Is generally
837 /// a scroll value. So does not have to come from mouse and could also originate
902 /// End the input mirroring process by resetting mouse grabbing
903 /// state to ensure the mouse cursor is not grabbed indefinitely.
1412 /// nk_window_is_hovered | Returns if the currently processed window is currently being hovered by mouse
4628 struct nk_mouse mouse;
13951 in->mouse.buttons[i].clicked = 0;
13954 in->mouse.scroll_delta = nk_vec2(0,0);
13955 in->mouse.prev.x = in->mouse.pos.x;
13956 in->mouse.prev.y = in->mouse.pos.y;
13957 in->mouse.delta.x = 0;
13958 in->mouse.delta.y = 0;
13969 if (in->mouse.grab)
13970 in->mouse.grab = 0;
13971 if (in->mouse.ungrab) {
13972 in->mouse.grabbed = 0;
13973 in->mouse.ungrab = 0;
13974 in->mouse.grab = 0;
13984 in->mouse.pos.x = (float)x;
13985 in->mouse.pos.y = (float)y;
13986 in->mouse.delta.x = in->mouse.pos.x - in->mouse.prev.x;
13987 in->mouse.delta.y = in->mouse.pos.y - in->mouse.prev.y;
14012 if (in->mouse.buttons[id].down == down) return;
14014 btn = &in->mouse.buttons[id];
14025 ctx->input.mouse.scroll_delta.x += val.x;
14026 ctx->input.mouse.scroll_delta.y += val.y;
14069 btn = &i->mouse.buttons[id];
14078 btn = &i->mouse.buttons[id];
14089 btn = &i->mouse.buttons[id];
14098 btn = &i->mouse.buttons[id];
14108 btn = &i->mouse.buttons[id];
14124 return NK_INBOX(i->mouse.pos.x, i->mouse.pos.y, rect.x, rect.y, rect.w, rect.h);
14130 return NK_INBOX(i->mouse.prev.x, i->mouse.prev.y, rect.x, rect.y, rect.w, rect.h);
14143 return i->mouse.buttons[id].down;
14150 b = &i->mouse.buttons[id];
14159 return (!i->mouse.buttons[id].down && i->mouse.buttons[id].clicked);
15214 if (ctx->style.cursor_active && !ctx->input.mouse.grabbed && ctx->style.cursor_visible) {
15220 mouse_bounds.x = ctx->input.mouse.pos.x - cursor->offset.x;
15221 mouse_bounds.y = ctx->input.mouse.pos.y - cursor->offset.y;
15660 left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
15661 left_mouse_clicked = (int)in->mouse.buttons[NK_BUTTON_LEFT].clicked;
15665 win->bounds.x = win->bounds.x + in->mouse.delta.x;
15666 win->bounds.y = win->bounds.y + in->mouse.delta.y;
15667 in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x += in->mouse.delta.x;
15668 in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.y += in->mouse.delta.y;
15915 /* mouse wheel scrolling */
15918 /* sub-window mouse wheel scrolling */
15945 /* window mouse wheel scrolling */
15947 if (in && (in->mouse.scroll_delta.y > 0 || in->mouse.scroll_delta.x > 0) && scroll_has_scrolling)
15969 in->mouse.scroll_delta.y = 0;
15992 int has_input = ctx->input.mouse.delta.x != 0 || ctx->input.mouse.delta.y != 0 || ctx->input.mouse.scroll_delta.y != 0;
16046 int left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
16051 float delta_x = in->mouse.delta.x;
16054 window->bounds.x += in->mouse.delta.x;
16058 if ((delta_x < 0) || (delta_x > 0 && in->mouse.pos.x >= scaler.x)) {
16060 scaler.x += in->mouse.delta.x;
16065 if (window_size.y < window->bounds.h + in->mouse.delta.y) {
16066 if ((in->mouse.delta.y < 0) || (in->mouse.delta.y > 0 && in->mouse.pos.y >= scaler.y)) {
16067 window->bounds.h = window->bounds.h + in->mouse.delta.y;
16068 scaler.y += in->mouse.delta.y;
16073 in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = scaler.x + scaler.w/2.0f;
16074 in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.y = scaler.y + scaler.h/2.0f;
16348 inpanel = inpanel && ctx->input.mouse.buttons[NK_BUTTON_LEFT].clicked;
16350 if ((win != ctx->active) && ishovered && !ctx->input.mouse.buttons[NK_BUTTON_LEFT].down) {
16376 if (NK_INBOX(ctx->input.mouse.pos.x, ctx->input.mouse.pos.y,
17103 body.x = ctx->input.mouse.pos.x;
17104 body.y = ctx->input.mouse.pos.y;
19180 if (!NK_INBOX(in->mouse.pos.x, in->mouse.pos.y, v.x, v.y, v.w, v.h))
21014 left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down;
21020 const float d = in->mouse.pos.x - (visual_cursor->x+visual_cursor->w*0.5f);
21031 in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = logical_cursor->x;
21267 left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down;
21275 float ratio = NK_MAX(0, (float)(in->mouse.pos.x - cursor.x)) / (float)cursor.w;
21277 in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = cursor.x + cursor.w/2.0f;
21417 left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
21418 left_mouse_clicked = in->mouse.buttons[NK_BUTTON_LEFT].clicked;
21424 scroll_delta = (o == NK_VERTICAL) ? in->mouse.scroll_delta.y: in->mouse.scroll_delta.x;
21426 /* update cursor by mouse dragging */
21431 pixel = in->mouse.delta.y;
21435 in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.y = cursor_y + cursor->h/2.0f;
21438 pixel = in->mouse.delta.x;
21442 in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = cursor_x + cursor->w/2.0f;
21458 /* update cursor by mouse scrolling */
21816 /* API click: on mouse down, move the cursor to the clicked location,
21827 /* API drag: on mouse drag, move the cursor and selection endpoint
22908 if (in && in->mouse.buttons[NK_BUTTON_LEFT].clicked && in->mouse.buttons[NK_BUTTON_LEFT].down) {
22909 edit->active = NK_INBOX(in->mouse.pos.x, in->mouse.pos.y,
22938 const float mouse_x = (in->mouse.pos.x - area.x) + edit->scrollbar.x;
22939 const float mouse_y = (in->mouse.pos.y - area.y) + edit->scrollbar.y;
22941 /* mouse click handler */
22945 } else if (is_hovered && in->mouse.buttons[NK_BUTTON_LEFT].down &&
22946 in->mouse.buttons[NK_BUTTON_LEFT].clicked) {
22948 } else if (is_hovered && in->mouse.buttons[NK_BUTTON_LEFT].down &&
22949 (in->mouse.delta.x != 0.0f || in->mouse.delta.y != 0.0f)) {
22952 } else if (is_hovered && in->mouse.buttons[NK_BUTTON_RIGHT].clicked &&
22953 in->mouse.buttons[NK_BUTTON_RIGHT].down) {
23540 int left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down;
23550 pixels = in->mouse.delta.x;
23921 ctx->input.mouse.grab = nk_true;
23922 ctx->input.mouse.grabbed = nk_true;
23928 ctx->input.mouse.grab = nk_false;
23929 ctx->input.mouse.grabbed = nk_false;
23930 ctx->input.mouse.ungrab = nk_true;
24159 NK_INBOX(i->mouse.pos.x,i->mouse.pos.y, g->slots[slot].last.x-3, g->slots[slot].last.y-3, 6, 6)){
24161 ret |= (i->mouse.buttons[NK_BUTTON_LEFT].down &&
24162 i->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0;
24184 ret |= (!i->mouse.buttons[NK_BUTTON_LEFT].down &&
24185 i->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0;
24233 NK_INBOX(in->mouse.pos.x,in->mouse.pos.y,item.x,item.y,item.w,item.h)) {
24235 ret |= (!in->mouse.buttons[NK_BUTTON_LEFT].down &&
24236 in->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0;
24368 hsva[1] = NK_SATURATE((in->mouse.pos.x - matrix->x) / (matrix->w-1));
24369 hsva[2] = 1.0f - NK_SATURATE((in->mouse.pos.y - matrix->y) / (matrix->h-1));
24374 hsva[0] = NK_SATURATE((in->mouse.pos.y - hue_bar->y) / (hue_bar->h-1));
24380 hsva[3] = 1.0f - NK_SATURATE((in->mouse.pos.y - alpha_bar->y) / (alpha_bar->h-1));
25339 x = nk_ifloorf(in->mouse.pos.x + 1) - (int)win->layout->clip.x;
25340 y = nk_ifloorf(in->mouse.pos.y + 1) - (int)win->layout->clip.y;
25538 /// - 2017/05/10 (1.38.3) - Fixed wrong min window size mouse scaling over boundries.
25650 /// - 2016/08/30 (1.14.0) - Removed mouse dragging from SDL demo since it does not work correctly.
25668 /// - 2016/08/29 (1.10.0) - Added experimental mouse scrolling to popups, menus and comboboxes.
25726 /// by hovering only if mouse is not pressed.