views:

270

answers:

0

I want to detect whether the alt/option key is pressed during a mouse drag in GTK on Mac OS X. I am using pygtk. Normally, holding down alt would add MOD1_MASK to event.state, but alt does affect event.state at all. In key press events alt shows up as gtk.keysyms.kana_switch, but this is not sufficient for my purposes since the user might press alt in a different application and switch to mine by clicking.

Is there an available setting that would cause alt/option to show up as a modifier in event.state? Alternatively, is there a way of detecting whether a key is currently down even if the key down event went to a different application?