Re: [gtk-vnc-devel] [PATCH] Add an interface for sending raw key presses



Jonh Wendell wrote:
Em Ter, 2007-10-23 às 22:26 -0500, Anthony Liguori escreveu:
I tried to use send_keys() for kvm-test but it wasn't sufficient. I'm unhappy that we have to have both interfaces but I still think most users would prefer send_keys().

Hi.

I didn't understand yet why to have 2 different api's to do the same
job. Why not to drop one of the them?

Vinagre doesn't use send_keys() yet, but i plan to add such
functionality soon.

send_keys() sends a press and release. send_key_raw() allows you to send press independently of release.

The goal was to make something like sending control-alt-delete easy:

.send_keys(['Control_L', 'Alt_L', 'delete'])

Verses what would be needed for send_key_raw():

.send_key_raw(gtk.gdk.keyval_from_name('Control_L'), 1)
.send_key_raw(gtk.gdk.keyval_from_name('Alt_L', 1))
.send_key_raw(gtk.gdk.keyval_from_name('delete', 1))
.send_key_raw(gtk.gdk.keyval_from_name('Control_L'), 0)
.send_key_raw(gtk.gdk.keyval_from_name('Alt_L', 0))
.send_key_raw(gtk.gdk.keyval_from_name('delete', 0))

It may be possible to unify the interface though. Maybe by having a second parameter to send_keys that was the event type. Possible event types would be PRESS, RELEASE, CLICK.

Regards,

Anthony Liguori
Cheers,





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]