Can someone please explain to me this code?

CTO debatem1 at
Sun May 3 06:03:48 CEST 2009

> root.change_attributes(event_mask = X.KeyPressMask)

This asks X to send this application keypress events

> root.grab_key(keycode, X.AnyModifier, 1,X.GrabModeAsync, X.GrabModeAsync)

This tells X to grab the keyboard if the given keycode is generated
any modifier is pressed, not to stop processing keyboard events, and
to stop processing pointer events. That's pretty safe, although I'm
sure if you'd need the modifier for your application.

More information about the Python-list mailing list