mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 05:40:04 +01:00
tools: add --replay-after and --once to libinput replay
For the cases where it's not possible to hit enter to start the replay because e.g. we cannot change focus, etc. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
bb21327efe
commit
41e7caac48
2 changed files with 26 additions and 1 deletions
|
|
@ -15,6 +15,13 @@ simultaneously.
|
||||||
.TP 8
|
.TP 8
|
||||||
.B \-\-help
|
.B \-\-help
|
||||||
Print help
|
Print help
|
||||||
|
.TP 8
|
||||||
|
.B \-\-once
|
||||||
|
Only replay the recording once, then exit.
|
||||||
|
.TP 8
|
||||||
|
.B \-\-replay-after=s
|
||||||
|
Replay the recording after waiting for s seconds. This replaces the default
|
||||||
|
interactive prompt to start the replay.
|
||||||
.SH NOTES
|
.SH NOTES
|
||||||
.PP
|
.PP
|
||||||
This tool replays events from a recording through the the kernel and is
|
This tool replays events from a recording through the the kernel and is
|
||||||
|
|
|
||||||
|
|
@ -269,6 +269,9 @@ def loop(args, recording):
|
||||||
return
|
return
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
if args.replay_after >= 0:
|
||||||
|
time.sleep(args.replay_after)
|
||||||
|
else:
|
||||||
input("Hit enter to start replaying")
|
input("Hit enter to start replaying")
|
||||||
|
|
||||||
processes = []
|
processes = []
|
||||||
|
|
@ -284,6 +287,9 @@ def loop(args, recording):
|
||||||
|
|
||||||
del processes
|
del processes
|
||||||
|
|
||||||
|
if args.once:
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
def create_device_quirk(device):
|
def create_device_quirk(device):
|
||||||
try:
|
try:
|
||||||
|
|
@ -363,6 +369,18 @@ def main():
|
||||||
type=str,
|
type=str,
|
||||||
help="Path to device recording",
|
help="Path to device recording",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--replay-after",
|
||||||
|
type=int,
|
||||||
|
default=-1,
|
||||||
|
help="Automatically replay once after N seconds",
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--once",
|
||||||
|
action="store_true",
|
||||||
|
default=False,
|
||||||
|
help="Stop and exit after one replay",
|
||||||
|
)
|
||||||
parser.add_argument("--verbose", action="store_true")
|
parser.add_argument("--verbose", action="store_true")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue