Enhance sendkey with key hold time (Jan Kiszka).
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 8 Jun 2008 22:45:01 +0000 (22:45 +0000)
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 8 Jun 2008 22:45:01 +0000 (22:45 +0000)
commitf594aab397de3fe1538bdf9ec68b1575994d4557
tree5d698284ac48ee79c1ac0da2552d4e2af7fd08bb
parent02e2407f1b0bd14ab1cd6ee4e1f325274d8e15ed
Enhance sendkey with key hold time (Jan Kiszka).

Current key injection via the monitor basically generates no key hold
time. This is fine for keyboard emulations that have their own queues,
but it causes troubles for those how don't (like the MusicPal - it
simply does not work with injected keys). Moreover, I would like to use
this mechanism to simulate pressed buttons during power-up.

Therefore, this patch enhances the key injection with a configurable
release delay (by default 100 virtual milliseconds).

This feature allows to get rid of the initial sleep() in musicpal_init
because one can now simply start qemu with -S and issue "sendkey m 1000"
and "continue" in the monitor to achieve the desired effect of a pressed
menu button during power-up. So there is no need for a per-musicpal or
even qemu-wide "-hold-button" switch.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4701 c046a42c-6fe2-441c-8c8c-71466251a162
hw/musicpal.c
monitor.c