Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^3: Gtk2 X11 GrabKey

by basiliscos (Pilgrim)
on Dec 14, 2013 at 16:05 UTC ( #1067154=note: print w/ replies, xml ) Need Help??

in reply to Re^2: Gtk2 X11 GrabKey
in thread Gtk2 X11 GrabKey

Thanks all!

Unfortunately I don't see event-loop in X11::Protocol, i.e. polling capabilities. I don't wan't go to low-level capabilities, i.e. poll underlying socket for events. I'll try to use the libkeybinder, and tell the details here.

PS. Mixed usage of Gtk2 events and X11 events seems to be leading to some messy:

... my $seq = $x->GrabKey( $k->KeysymToKeycode("z"), 'AnyModifier', $x->root, 0, 'Asynchronous', 'Asynchronous'); $x->event_handler('queue'); my %event = $x->next_event; ### %event my $t = AE::timer 0, 1, sub { my %event = $x->next_event; # %event }; Gtk2->main;
It exists with:
Protocol error: bad 2 (Value); Sequence Number 4 Opcode (33, 0) = GrabKey Bad value 183 (0xb7) at ./gtk-treeview-action line 31.

Comment on Re^3: Gtk2 X11 GrabKey
Select or Download Code
Replies are listed 'Best First'.
Re^4: Gtk2 X11 GrabKey
by dcmertens (Beadle) on Dec 14, 2013 at 18:32 UTC

    Shouldn't you say something like return unless my %event = $x->dequeue_event rather than $x->next_event? The docs seem to suggest that next_event will block until you get your final results. As to your error, I'm not sure what to say as I don't use X11. Sorry.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1067154]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2015-12-01 00:15 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (788 votes), past polls