Skip to content

Commit aa19fb3

Browse files
committed
button_action
1 parent 7c26c5a commit aa19fb3

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

src/ruisapp/glue/android/glue.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ void handle_input_events()
233233
utki::assert(win, SL);
234234

235235
win->gui.send_mouse_button(
236-
true, // is_down
236+
ruis::button_action::press, //
237237
win->android_win_coords_to_ruisapp_win_rect_coords(p), // pos
238238
ruis::mouse_button::left,
239239
pointer_id
@@ -270,7 +270,7 @@ void handle_input_events()
270270
utki::assert(win, SL);
271271

272272
win->gui.send_mouse_button(
273-
false, // is_down
273+
ruis::button_action::release, //
274274
win->android_win_coords_to_ruisapp_win_rect_coords(p), // pos
275275
ruis::mouse_button::left,
276276
pointer_id
@@ -347,7 +347,7 @@ void handle_input_events()
347347
// detect auto-repeated key events
348348
if (AKeyEvent_getRepeatCount(event) == 0) {
349349
win->gui.send_key(
350-
true, // is_down
350+
ruis::button_action::press, //
351351
key
352352
);
353353
}
@@ -360,7 +360,7 @@ void handle_input_events()
360360
case AKEY_EVENT_ACTION_UP:
361361
// utki::log_debug([&](auto&o){o << "AKEY_EVENT_ACTION_UP" << std::endl;});
362362
win->gui.send_key(
363-
false, // is_down
363+
ruis::button_action::release, //
364364
key
365365
);
366366
break;

src/ruisapp/glue/ios/window.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2525

2626
namespace {
2727
void handle_mouse_button(
28-
bool is_down, //
28+
button_action action, //
2929
const ruis::vec2& pos,
3030
ruis::mouse_button button,
3131
unsigned pointer_id
@@ -39,7 +39,7 @@ void handle_mouse_button(
3939
}
4040

4141
win->gui.send_mouse_button(
42-
is_down, //
42+
action, //
4343
pos,
4444
button,
4545
pointer_id
@@ -180,7 +180,7 @@ void handle_mouse_move(
180180

181181
using std::round;
182182
handle_mouse_button(
183-
true, // is_down
183+
ruis::button_action::press, //
184184
round(ruis::vec2(p.x * scale, p.y * scale)), // pos
185185
ruis::mouse_button::left,
186186
0 // TODO: pointer id
@@ -212,7 +212,7 @@ void handle_mouse_move(
212212

213213
using std::round;
214214
handle_mouse_button(
215-
false, // is_down
215+
ruis::button_action::release, //
216216
round(ruis::vec2(p.x * scale, p.y * scale)), // pos
217217
ruis::mouse_button::left,
218218
0 // TODO: pointer id

src/ruisapp/glue/linux/wayland/wayland_touch.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void wayland_touch_wrapper::wl_touch_down(
7575
const touch_point& tp = insert_result.first->second;
7676

7777
win.gui.send_mouse_button(
78-
true, // is_down
78+
ruis::button_action::press, //
7979
tp.pos,
8080
ruis::mouse_button::left,
8181
tp.ruis_id
@@ -106,7 +106,7 @@ void wayland_touch_wrapper::wl_touch_up(
106106
auto& glue = get_glue();
107107
if (auto window = glue.get_window(tp.surface)) {
108108
window->gui.send_mouse_button(
109-
false, // is_down
109+
ruis::button_action::release, //
110110
tp.pos,
111111
ruis::mouse_button::left,
112112
tp.ruis_id
@@ -183,7 +183,7 @@ void wayland_touch_wrapper::wl_touch_cancel(
183183
}
184184

185185
window->gui.send_mouse_button(
186-
false, // is_down
186+
ruis::button_action::release, //
187187
{-1, -1},
188188
ruis::mouse_button::left,
189189
tp.ruis_id

src/ruisapp/glue/macos/window.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2828
namespace {
2929
void handle_mouse_button(
3030
NSEvent* e, //
31-
bool is_down,
31+
ruis::button_action action,
3232
ruis::mouse_button button,
3333
app_window& w
3434
)
@@ -44,7 +44,7 @@ void handle_mouse_button(
4444
utki::logcat_debug("mouse down pos = ", pos, '\n');
4545

4646
w.gui.send_mouse_button(
47-
is_down, //
47+
action, //
4848
pos,
4949
button,
5050
0
@@ -101,13 +101,13 @@ void handle_mouse_hover(
101101

102102
namespace {
103103
void handle_key_event(
104-
bool is_down, //
104+
ruis::button_action action, //
105105
ruis::key key_code,
106106
app_window& w
107107
)
108108
{
109109
w.gui.send_key(
110-
is_down, //
110+
action, //
111111
key_code
112112
);
113113
}

0 commit comments

Comments
 (0)