mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-04-20 06:10:41 +02:00
proto: Various stylus changes & fixes
Added range checking and clamping for various values Fixing various errors or identation issues Removing unused or uneeded methods/code and other minor changes
This commit is contained in:
parent
499633efd2
commit
c248abf228
18 changed files with 105 additions and 104 deletions
|
|
@ -1872,10 +1872,9 @@
|
|||
location that exists outside of these locations. The EIS implementation
|
||||
may clamp out-of-range values and/or disconnect the client.
|
||||
|
||||
This request must be in the same frame as
|
||||
ei_stylus.proximity_in. It may also be sent while the stylus is in or
|
||||
leaving proximity. It is a protocol violation to send this request at
|
||||
any other time.
|
||||
This request must be in the same frame as ei_stylus.proximity_in.
|
||||
It may also be sent while the stylus is in or leaving proximity.
|
||||
It is a protocol violation to send this request at any other time.
|
||||
</description>
|
||||
<arg name="x" type="float" summary="The x position of the stylus in mm or logical pixels."/>
|
||||
<arg name="y" type="float" summary="The y position of the stylus in mm or logical pixels."/>
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ handle_msg_done(struct ei_device *device)
|
|||
ei_device_has_capability(device, EI_DEVICE_CAP_TOUCH) ? "t" : "",
|
||||
ei_device_has_capability(device, EI_DEVICE_CAP_BUTTON) ? "b" : "",
|
||||
ei_device_has_capability(device, EI_DEVICE_CAP_SCROLL) ? "s" : "",
|
||||
ei_device_has_capability(device, EI_DEVICE_CAP_STYLUS) ? "y" : "",
|
||||
ei_device_has_capability(device, EI_DEVICE_CAP_STYLUS) ? "S" : "",
|
||||
ei_seat_get_name(ei_device_get_seat(device)));
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -2116,8 +2116,6 @@ ei_send_stylus_bind_tool_capabilities(struct ei_device *device, uint32_t capabil
|
|||
if (ei->state == EI_STATE_NEW || ei->state == EI_STATE_DISCONNECTED)
|
||||
return 0;
|
||||
|
||||
device->send_frame_event = false;
|
||||
|
||||
int rc = ei_stylus_request_bind_tool_capabilities(device->stylus, capabilities);
|
||||
if (rc)
|
||||
ei_disconnect(ei);
|
||||
|
|
@ -2195,7 +2193,13 @@ ei_device_stylus_pressure(struct ei_device *device, float pressure)
|
|||
return;
|
||||
}
|
||||
|
||||
ei_send_stylus_pressure(device, pressure);
|
||||
if (pressure < 0 || pressure > 1) {
|
||||
log_bug_client(ei_device_get_context(device),
|
||||
"%s: pressure out of range, clamping value to range.", __func__);
|
||||
ei_send_stylus_pressure(device, pressure < 0 ? 0 : 1);
|
||||
} else {
|
||||
ei_send_stylus_pressure(device, pressure);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -2223,7 +2227,13 @@ ei_device_stylus_distance(struct ei_device *device, float distance)
|
|||
return;
|
||||
}
|
||||
|
||||
ei_send_stylus_distance(device, distance);
|
||||
if (distance < 0 || distance > 1) {
|
||||
log_bug_client(ei_device_get_context(device),
|
||||
"%s: distance out of range, clamping value to range.", __func__);
|
||||
ei_send_stylus_distance(device, distance < 0 ? 0 : 1);
|
||||
} else {
|
||||
ei_send_stylus_distance(device, distance);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -2245,13 +2255,28 @@ ei_send_stylus_tilt(struct ei_device *device, float tilt_x, float tilt_y)
|
|||
_public_ void
|
||||
ei_device_stylus_tilt(struct ei_device *device, float tilt_x, float tilt_y)
|
||||
{
|
||||
float clamped_tilt_x = tilt_x;
|
||||
float clamped_tilt_y = tilt_y;
|
||||
|
||||
if (device->state != EI_DEVICE_STATE_EMULATING) {
|
||||
log_bug_client(ei_device_get_context(device),
|
||||
"%s: device is not emulating", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
ei_send_stylus_tilt(device, tilt_x, tilt_y);
|
||||
if (tilt_x < -90 || tilt_x > 90) {
|
||||
log_bug_client(ei_device_get_context(device),
|
||||
"%s: tilt_x out of range, clamping value to range.", __func__);
|
||||
clamped_tilt_x = tilt_x < -90 ? -90 : 90;
|
||||
}
|
||||
|
||||
if (tilt_y < -90 || tilt_y > 90) {
|
||||
log_bug_client(ei_device_get_context(device),
|
||||
"%s: tilt_y out of range, clamping value to range.", __func__);
|
||||
clamped_tilt_y = tilt_y < -90 ? -90 : 90;
|
||||
}
|
||||
|
||||
ei_send_stylus_tilt(device, clamped_tilt_x, clamped_tilt_y);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -2279,7 +2304,13 @@ ei_device_stylus_rotation(struct ei_device *device, float rotation)
|
|||
return;
|
||||
}
|
||||
|
||||
ei_send_stylus_rotation(device, rotation);
|
||||
if (rotation < 0 || rotation >= 360) {
|
||||
log_bug_client(ei_device_get_context(device),
|
||||
"%s: rotation out of range, clamping value to range.", __func__);
|
||||
ei_send_stylus_rotation(device, rotation < 0 ? 0 : fmod(rotation, 360));
|
||||
} else {
|
||||
ei_send_stylus_rotation(device, rotation);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -2307,7 +2338,13 @@ ei_device_stylus_airbrush_flow(struct ei_device *device, float flow)
|
|||
return;
|
||||
}
|
||||
|
||||
ei_send_stylus_airbrush_flow(device, flow);
|
||||
if (flow < 0 || flow > 1) {
|
||||
log_bug_client(ei_device_get_context(device),
|
||||
"%s: airbrush flow out of range, clamping value to range.", __func__);
|
||||
ei_send_stylus_airbrush_flow(device, flow < 0 ? 0 : 1);
|
||||
} else {
|
||||
ei_send_stylus_airbrush_flow(device, flow);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -412,36 +412,6 @@ ei_event_stylus_get_capability(struct ei_event *event)
|
|||
return event->stylus.capability;
|
||||
}
|
||||
|
||||
_public_ bool
|
||||
ei_event_stylus_get_is_prox(struct ei_event *event)
|
||||
{
|
||||
require_event_type(event, 0.0,
|
||||
EI_EVENT_STYLUS_PROXIMITY_IN,
|
||||
EI_EVENT_STYLUS_PROXIMITY_OUT);
|
||||
|
||||
return event->stylus.is_prox;
|
||||
}
|
||||
|
||||
_public_ bool
|
||||
ei_event_stylus_get_is_down(struct ei_event *event)
|
||||
{
|
||||
require_event_type(event, 0.0,
|
||||
EI_EVENT_STYLUS_DOWN,
|
||||
EI_EVENT_STYLUS_UP);
|
||||
|
||||
return event->stylus.is_down;
|
||||
}
|
||||
|
||||
_public_ bool
|
||||
ei_event_stylus_get_is_erase(struct ei_event *event)
|
||||
{
|
||||
require_event_type(event, 0.0,
|
||||
EI_EVENT_STYLUS_ERASE_START,
|
||||
EI_EVENT_STYLUS_ERASE_STOP);
|
||||
|
||||
return event->stylus.is_erase;
|
||||
}
|
||||
|
||||
_public_ float
|
||||
ei_event_stylus_get_x(struct ei_event *event)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ struct ei_event {
|
|||
} sync;
|
||||
struct {
|
||||
uint32_t capability;
|
||||
bool is_prox, is_down, is_erase;
|
||||
bool is_prox, is_down, is_erasing;
|
||||
float x, y, pressure, distance, rotation, flow;
|
||||
float tilt_x, tilt_y;
|
||||
} stylus;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2023 Red Hat, Inc.
|
||||
* Copyright © 2025 Wacom Co., Ltd.
|
||||
* Copyright © 2025 Joshua Dickens <joshua.dickens@wacom.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2023 Red Hat, Inc.
|
||||
* Copyright © 2025 Wacom Co., Ltd.
|
||||
* Copyright © 2025 Joshua Dickens <joshua.dickens@wacom.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
|
|||
|
|
@ -256,7 +256,6 @@ update_event_timestamp(struct ei_event *event, uint64_t time)
|
|||
case EI_EVENT_STYLUS_TILT:
|
||||
case EI_EVENT_STYLUS_ROTATION:
|
||||
case EI_EVENT_STYLUS_AIRBRUSH_FLOW:
|
||||
case EI_EVENT_STYLUS_TOOL_CAPABILITIES:
|
||||
case EI_EVENT_STYLUS_ERASE_START:
|
||||
case EI_EVENT_STYLUS_ERASE_STOP:
|
||||
if (event->timestamp != 0) {
|
||||
|
|
@ -692,7 +691,7 @@ ei_queue_stylus_erase_start_event(struct ei_device *device)
|
|||
struct ei_event *e = ei_event_new_for_device(device);
|
||||
|
||||
e->type = EI_EVENT_STYLUS_ERASE_START;
|
||||
e->stylus.is_erase = true;
|
||||
e->stylus.is_erasing = true;
|
||||
|
||||
queue_event(ei_device_get_context(device), e);
|
||||
}
|
||||
|
|
@ -703,7 +702,7 @@ ei_queue_stylus_erase_stop_event(struct ei_device *device)
|
|||
struct ei_event *e = ei_event_new_for_device(device);
|
||||
|
||||
e->type = EI_EVENT_STYLUS_ERASE_STOP;
|
||||
e->stylus.is_erase = false;
|
||||
e->stylus.is_erasing = false;
|
||||
|
||||
queue_event(ei_device_get_context(device), e);
|
||||
}
|
||||
|
|
|
|||
32
src/libei.h
32
src/libei.h
|
|
@ -2036,14 +2036,6 @@ ei_touch_get_user_data(struct ei_touch *touch);
|
|||
struct ei_device *
|
||||
ei_touch_get_device(struct ei_touch *touch);
|
||||
|
||||
/**
|
||||
* @ingroup libei-sender
|
||||
*
|
||||
* TODO
|
||||
*/
|
||||
struct ei_stylus *
|
||||
ei_device_stylus_new(struct ei_device *device);
|
||||
|
||||
/**
|
||||
* @ingroup libei-sender
|
||||
*
|
||||
|
|
@ -2411,22 +2403,6 @@ ei_event_touch_get_y(struct ei_event *event);
|
|||
bool
|
||||
ei_event_touch_get_is_cancel(struct ei_event *event);
|
||||
|
||||
/**
|
||||
* @ingroup libei-receiver
|
||||
*
|
||||
* TODO
|
||||
*/
|
||||
bool
|
||||
ei_event_stylus_get_is_prox(struct ei_event *event);
|
||||
|
||||
/**
|
||||
* @ingroup libei-receiver
|
||||
*
|
||||
* TODO
|
||||
*/
|
||||
bool
|
||||
ei_event_stylus_get_is_erase(struct ei_event *event);
|
||||
|
||||
/**
|
||||
* @ingroup libei-receiver
|
||||
*
|
||||
|
|
@ -2443,14 +2419,6 @@ ei_event_stylus_get_capability(struct ei_event *event);
|
|||
uint32_t
|
||||
ei_event_stylus_get_code(struct ei_event *event);
|
||||
|
||||
/**
|
||||
* @ingroup libei-receiver
|
||||
*
|
||||
* TODO
|
||||
*/
|
||||
bool
|
||||
ei_event_stylus_get_is_down(struct ei_event *event);
|
||||
|
||||
/**
|
||||
* @ingroup libei-receiver
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1802,6 +1802,14 @@ eis_device_stylus_new(struct eis_device *device)
|
|||
_public_ void
|
||||
eis_device_stylus_tool_capabilities(struct eis_device *device, uint32_t capability)
|
||||
{
|
||||
uint32_t valid_cap_mask =
|
||||
EIS_STYLUS_CAPABILITY_ERASE |
|
||||
EIS_STYLUS_CAPABILITY_PRESSURE |
|
||||
EIS_STYLUS_CAPABILITY_DISTANCE |
|
||||
EIS_STYLUS_CAPABILITY_TILT |
|
||||
EIS_STYLUS_CAPABILITY_ROTATION |
|
||||
EIS_STYLUS_CAPABILITY_AIRBRUSH_FLOW;
|
||||
|
||||
if (!eis_device_has_capability(device, EIS_DEVICE_CAP_STYLUS)) {
|
||||
log_bug_client(eis_device_get_context(device),
|
||||
"%s: device is not a stylus device", __func__);
|
||||
|
|
@ -1811,9 +1819,12 @@ eis_device_stylus_tool_capabilities(struct eis_device *device, uint32_t capabili
|
|||
if (device->state != EIS_DEVICE_STATE_NEW)
|
||||
return;
|
||||
|
||||
device->send_frame_event = false;
|
||||
if ((capability & valid_cap_mask) != capability) {
|
||||
log_bug_client(eis_device_get_context(device),
|
||||
"%s: value contains undefined capabilities, ignoring undefined bits.", __func__);
|
||||
}
|
||||
|
||||
eis_stylus_event_tool_capabilities(device->stylus, capability);
|
||||
eis_stylus_event_tool_capabilities(device->stylus, capability & valid_cap_mask);
|
||||
}
|
||||
|
||||
_public_ void
|
||||
|
|
|
|||
|
|
@ -469,13 +469,13 @@ eis_event_stylus_get_is_prox(struct eis_event *event)
|
|||
}
|
||||
|
||||
_public_ bool
|
||||
eis_event_stylus_get_is_erase(struct eis_event *event)
|
||||
eis_event_stylus_get_is_erasing(struct eis_event *event)
|
||||
{
|
||||
require_event_type(event, 0,
|
||||
EIS_EVENT_STYLUS_ERASE_START,
|
||||
EIS_EVENT_STYLUS_ERASE_STOP);
|
||||
|
||||
return event->stylus.is_erase;
|
||||
return event->stylus.is_erasing;
|
||||
}
|
||||
|
||||
_public_ uint32_t
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ struct eis_event {
|
|||
uint32_t capability;
|
||||
float x, y, pressure, distance, rotation, flow;
|
||||
float tilt_x, tilt_y;
|
||||
bool is_prox, is_down, is_erase;
|
||||
bool is_prox, is_down, is_erasing;
|
||||
} stylus;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2023 Red Hat, Inc.
|
||||
* Copyright © 2025 Wacom Co., Ltd.
|
||||
* Copyright © 2025 Joshua Dickens <joshua.dickens@wacom.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2020 Red Hat, Inc.
|
||||
* Copyright © 2025 Wacom Co., Ltd.
|
||||
* Copyright © 2025 Joshua Dickens <joshua.dickens@wacom.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
|
|||
|
|
@ -545,7 +545,7 @@ eis_queue_stylus_erase_start_event(struct eis_device *device)
|
|||
{
|
||||
struct eis_event *e = eis_event_new_for_device(device);
|
||||
e->type = EIS_EVENT_STYLUS_ERASE_START;
|
||||
e->stylus.is_erase = true;
|
||||
e->stylus.is_erasing = true;
|
||||
eis_queue_event(e);
|
||||
}
|
||||
|
||||
|
|
@ -554,7 +554,7 @@ eis_queue_stylus_erase_stop_event(struct eis_device *device)
|
|||
{
|
||||
struct eis_event *e = eis_event_new_for_device(device);
|
||||
e->type = EIS_EVENT_STYLUS_ERASE_STOP;
|
||||
e->stylus.is_erase = false;
|
||||
e->stylus.is_erasing = false;
|
||||
eis_queue_event(e);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1734,6 +1734,7 @@ eis_touch_get_device(struct eis_touch *touch);
|
|||
|
||||
/**
|
||||
* @ingroup libeis-receiver
|
||||
* @ingroup libeis-sender
|
||||
* TODO
|
||||
*/
|
||||
struct eis_stylus *
|
||||
|
|
@ -2035,7 +2036,7 @@ eis_event_stylus_get_is_prox(struct eis_event *event);
|
|||
* TODO
|
||||
*/
|
||||
bool
|
||||
eis_event_stylus_get_is_erase(struct eis_event *event);
|
||||
eis_event_stylus_get_is_erasing(struct eis_event *event);
|
||||
|
||||
/**
|
||||
* @ingroup libeis-sender
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ if build_libei
|
|||
'libei-scroll.c',
|
||||
'libei-seat.c',
|
||||
'libei-socket.c',
|
||||
'libei-stylus.c',
|
||||
'libei-stylus.c',
|
||||
'libei-touchscreen.c',
|
||||
) + [brei_proto_headers, ei_proto_headers, ei_proto_sources]
|
||||
|
||||
|
|
|
|||
|
|
@ -1521,6 +1521,9 @@ MUNIT_TEST(test_ei_device_stylus)
|
|||
ei_device_stylus_proximity_in(device);
|
||||
ei_device_frame(device, peck_ei_now(peck));
|
||||
|
||||
ei_device_stylus_down(device);
|
||||
ei_device_frame(device, peck_ei_now(peck));
|
||||
|
||||
ei_device_stylus_motion(device, 0.1 , 0.2);
|
||||
ei_device_frame(device, peck_ei_now(peck));
|
||||
|
||||
|
|
@ -1545,6 +1548,9 @@ MUNIT_TEST(test_ei_device_stylus)
|
|||
ei_device_stylus_erase_stop(device);
|
||||
ei_device_frame(device, peck_ei_now(peck));
|
||||
|
||||
ei_device_stylus_up(device);
|
||||
ei_device_frame(device, peck_ei_now(peck));
|
||||
|
||||
ei_device_stylus_proximity_out(device);
|
||||
ei_device_frame(device, peck_ei_now(peck));
|
||||
}
|
||||
|
|
@ -1554,7 +1560,9 @@ MUNIT_TEST(test_ei_device_stylus)
|
|||
with_server(peck) {
|
||||
_unref_(eis_event) *proximity_in =
|
||||
peck_eis_next_event(eis, EIS_EVENT_STYLUS_PROXIMITY_IN);
|
||||
munit_assert_true(eis_event_stylus_get_is_prox(proximity_in));
|
||||
|
||||
_unref_(eis_event) *down =
|
||||
peck_eis_next_event(eis, EIS_EVENT_STYLUS_DOWN);
|
||||
|
||||
_unref_(eis_event) *motion =
|
||||
peck_eis_next_event(eis, EIS_EVENT_STYLUS_MOTION);
|
||||
|
|
@ -1584,15 +1592,15 @@ MUNIT_TEST(test_ei_device_stylus)
|
|||
|
||||
_unref_(eis_event) *erase_start =
|
||||
peck_eis_next_event(eis, EIS_EVENT_STYLUS_ERASE_START);
|
||||
munit_assert_true(eis_event_stylus_get_is_erase(erase_start));
|
||||
|
||||
_unref_(eis_event) *erase_stop =
|
||||
peck_eis_next_event(eis, EIS_EVENT_STYLUS_ERASE_STOP);
|
||||
munit_assert_false(eis_event_stylus_get_is_erase(erase_stop));
|
||||
|
||||
_unref_(eis_event) *up =
|
||||
peck_eis_next_event(eis, EIS_EVENT_STYLUS_UP);
|
||||
|
||||
_unref_(eis_event) *proximity_out =
|
||||
peck_eis_next_event(eis, EIS_EVENT_STYLUS_PROXIMITY_OUT);
|
||||
munit_assert_false(eis_event_stylus_get_is_prox(proximity_out));
|
||||
|
||||
peck_assert_no_eis_events(eis);
|
||||
}
|
||||
|
|
@ -3063,6 +3071,9 @@ MUNIT_TEST(test_passive_ei_device_stylus)
|
|||
eis_device_stylus_proximity_in(device);
|
||||
eis_device_frame(device, peck_eis_now(peck));
|
||||
|
||||
eis_device_stylus_down(device);
|
||||
eis_device_frame(device, peck_eis_now(peck));
|
||||
|
||||
eis_device_stylus_motion(device, 0.1 , 0.2);
|
||||
eis_device_frame(device, peck_eis_now(peck));
|
||||
|
||||
|
|
@ -3087,6 +3098,9 @@ MUNIT_TEST(test_passive_ei_device_stylus)
|
|||
eis_device_stylus_erase_stop(device);
|
||||
eis_device_frame(device, peck_eis_now(peck));
|
||||
|
||||
eis_device_stylus_up(device);
|
||||
eis_device_frame(device, peck_eis_now(peck));
|
||||
|
||||
eis_device_stylus_proximity_out(device);
|
||||
eis_device_frame(device, peck_eis_now(peck));
|
||||
}
|
||||
|
|
@ -3096,7 +3110,9 @@ MUNIT_TEST(test_passive_ei_device_stylus)
|
|||
with_client(peck) {
|
||||
_unref_(ei_event) *proximity_in =
|
||||
peck_ei_next_event(ei, EI_EVENT_STYLUS_PROXIMITY_IN);
|
||||
munit_assert_true(ei_event_stylus_get_is_prox(proximity_in));
|
||||
|
||||
_unref_(ei_event) *down =
|
||||
peck_ei_next_event(ei, EI_EVENT_STYLUS_DOWN);
|
||||
|
||||
_unref_(ei_event) *motion =
|
||||
peck_ei_next_event(ei, EI_EVENT_STYLUS_MOTION);
|
||||
|
|
@ -3126,15 +3142,15 @@ MUNIT_TEST(test_passive_ei_device_stylus)
|
|||
|
||||
_unref_(ei_event) *erase_start =
|
||||
peck_ei_next_event(ei, EI_EVENT_STYLUS_ERASE_START);
|
||||
munit_assert_true(ei_event_stylus_get_is_erase(erase_start));
|
||||
|
||||
_unref_(ei_event) *erase_stop =
|
||||
peck_ei_next_event(ei, EI_EVENT_STYLUS_ERASE_STOP);
|
||||
munit_assert_false(ei_event_stylus_get_is_erase(erase_stop));
|
||||
|
||||
_unref_(ei_event) *up =
|
||||
peck_ei_next_event(ei, EI_EVENT_STYLUS_UP);
|
||||
|
||||
_unref_(ei_event) *proximity_out =
|
||||
peck_ei_next_event(ei, EI_EVENT_STYLUS_PROXIMITY_OUT);
|
||||
munit_assert_false(ei_event_stylus_get_is_prox(proximity_out));
|
||||
|
||||
peck_assert_no_ei_events(ei);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -300,10 +300,6 @@ print_stylus_event(struct ei_event *event)
|
|||
{
|
||||
print_device(event);
|
||||
|
||||
bool down = ei_event_stylus_get_is_down(event);
|
||||
bool prox = ei_event_stylus_get_is_prox(event);
|
||||
bool erase = ei_event_stylus_get_is_erase(event);
|
||||
|
||||
uint32_t capability = ei_event_stylus_get_capability(event);
|
||||
|
||||
float x = ei_event_stylus_get_x(event);
|
||||
|
|
@ -315,7 +311,7 @@ print_stylus_event(struct ei_event *event)
|
|||
float tilt_x = ei_event_stylus_get_tilt_x(event);
|
||||
float tilt_y = ei_event_stylus_get_tilt_y(event);
|
||||
|
||||
printf(" stylus: [down - %s, prox - %s, erase - %s]\n[x - %f, y - %f, p - %f, d - %f, r - %f, s - %f, tilt_x - %f, tilt_y - %f]\n[Capability - %u]", truefalse(down), truefalse(prox), truefalse(erase), x, y, p, d, r, s, tilt_x, tilt_y, capability);
|
||||
printf(" stylus: [x - %f, y - %f, p - %f, d - %f, r - %f, s - %f, tilt_x - %f, tilt_y - %f]\n[Capability - %u]", x, y, p, d, r, s, tilt_x, tilt_y, capability);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue