All pastes #184008 Raw Edit

Mine

public text v1 · immutable
#184008 ·published 2006-09-27 13:39 UTC
rendered paste body
    mask = 0
    # map the pretty keyboard event name string to the real AT-SPI constant
    type = [Constants.name_to_device_type[name]]
    # get an AT-SPI device event controller
    dc = registry.getDeviceEventController()
    # register for all possible key combos (plain key, key+shift, key+alt, ...)
    while mask <= (1 << Accessibility.MODIFIER_NUMLOCK):
      dc.registerKeystrokeListener(self._this(), [], mask, type, self.mode)
      mask += 1