Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libinput
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
90
Issues
90
List
Boards
Labels
Service Desk
Milestones
Merge Requests
10
Merge Requests
10
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
libinput
libinput
Commits
27bf3fb2
Commit
27bf3fb2
authored
Oct 31, 2018
by
Peter Hutterer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: allow measuring single-touch ABS_PRESSURE
Fixes
#173
Signed-off-by:
Peter Hutterer
<
peter.hutterer@who-t.net
>
parent
6041d0ba
Pipeline
#7681
passed with stages
in 5 minutes and 2 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
tools/libinput-measure-touchpad-pressure.py
tools/libinput-measure-touchpad-pressure.py
+8
-2
No files found.
tools/libinput-measure-touchpad-pressure.py
View file @
27bf3fb2
...
...
@@ -170,7 +170,12 @@ class Device(object):
caps
=
all_caps
.
get
(
evdev
.
ecodes
.
EV_ABS
,
[])
p
=
[
cap
[
1
]
for
cap
in
caps
if
cap
[
0
]
==
evdev
.
ecodes
.
ABS_MT_PRESSURE
]
if
not
p
:
raise
InvalidDeviceError
(
"device does not have ABS_MT_PRESSURE"
)
p
=
[
cap
[
1
]
for
cap
in
caps
if
cap
[
0
]
==
evdev
.
ecodes
.
ABS_PRESSURE
]
if
not
p
:
raise
InvalidDeviceError
(
"device does not have ABS_PRESSURE/ABS_MT_PRESSURE"
)
self
.
has_mt_pressure
=
False
else
:
self
.
has_mt_pressure
=
True
p
=
p
[
0
]
prange
=
p
.
max
-
p
.
min
...
...
@@ -247,7 +252,8 @@ def handle_abs(device, event):
except
IndexError
:
# If the finger was down at startup
pass
elif
event
.
code
==
evdev
.
ecodes
.
ABS_MT_PRESSURE
:
elif
((
event
.
code
==
evdev
.
ecodes
.
ABS_MT_PRESSURE
)
or
(
event
.
code
==
evdev
.
ecodes
.
ABS_PRESSURE
and
not
device
.
has_mt_pressure
)):
try
:
s
=
device
.
current_sequence
()
s
.
append
(
Touch
(
pressure
=
event
.
value
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment