Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libtcg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anton
libtcg
Commits
2e377f17
Commit
2e377f17
authored
10 years ago
by
Gerd Hoffmann
Browse files
Options
Downloads
Patches
Plain Diff
input: use kbd delays for send_key monitor command
Signed-off-by:
Gerd Hoffmann
<
kraxel@redhat.com
>
parent
be1a7176
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ui/input-legacy.c
+6
-39
6 additions, 39 deletions
ui/input-legacy.c
with
6 additions
and
39 deletions
ui/input-legacy.c
+
6
−
39
View file @
2e377f17
...
...
@@ -74,27 +74,6 @@ int index_from_key(const char *key)
return
i
;
}
static
KeyValue
**
keyvalues
;
static
int
keyvalues_size
;
static
QEMUTimer
*
key_timer
;
static
void
free_keyvalues
(
void
)
{
g_free
(
keyvalues
);
keyvalues
=
NULL
;
keyvalues_size
=
0
;
}
static
void
release_keys
(
void
*
opaque
)
{
while
(
keyvalues_size
>
0
)
{
qemu_input_event_send_key
(
NULL
,
keyvalues
[
--
keyvalues_size
],
false
);
}
free_keyvalues
();
}
static
KeyValue
*
copy_key_value
(
KeyValue
*
src
)
{
KeyValue
*
dst
=
g_new
(
KeyValue
,
1
);
...
...
@@ -107,30 +86,18 @@ void qmp_send_key(KeyValueList *keys, bool has_hold_time, int64_t hold_time,
{
KeyValueList
*
p
;
if
(
!
key_timer
)
{
key_timer
=
timer_new_ns
(
QEMU_CLOCK_VIRTUAL
,
release_keys
,
NULL
);
}
if
(
keyvalues
!=
NULL
)
{
timer_del
(
key_timer
);
release_keys
(
NULL
);
}
if
(
!
has_hold_time
)
{
hold_time
=
10
0
;
hold_time
=
0
;
/* use default */
}
for
(
p
=
keys
;
p
!=
NULL
;
p
=
p
->
next
)
{
qemu_input_event_send_key
(
NULL
,
copy_key_value
(
p
->
value
),
true
);
keyvalues
=
g_realloc
(
keyvalues
,
sizeof
(
KeyValue
*
)
*
(
keyvalues_size
+
1
));
keyvalues
[
keyvalues_size
++
]
=
copy_key_value
(
p
->
value
);
qemu_input_event_send_key_delay
(
hold_time
);
}
for
(
p
=
keys
;
p
!=
NULL
;
p
=
p
->
next
)
{
qemu_input_event_send_key
(
NULL
,
copy_key_value
(
p
->
value
),
false
);
qemu_input_event_send_key_delay
(
hold_time
);
}
/* delayed key up events */
timer_mod
(
key_timer
,
qemu_clock_get_ns
(
QEMU_CLOCK_VIRTUAL
)
+
muldiv64
(
get_ticks_per_sec
(),
hold_time
,
1000
));
}
static
void
legacy_kbd_event
(
DeviceState
*
dev
,
QemuConsole
*
src
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment