gdk_keymap_translate_keymap_state : unconsumed_modifiers



The docs for this parameter say:

 * @unused_modifiers: return location for modifiers that didn't affect the group or level

However, the implementation (for XKB) actually returns something
different -- a mask of modifiers that were consumed to determine the level.

This confusion seems to also be present in the XTranslateKeycodes docs. The corresponding
parameter 'mods_rtrn' is commented as "backfilled with unconsumed modifiers", but
the body of the docs says:

 "mods_rtrn is backfilled with the modifiers consumed by the translation_process"

The "consumed modifiers" interpretation is probably marginally more useful than the 
unconsumed modifiers interpretation ... e.g., if you want to tell whether a keypress
of "+" matches a spec of "<shift>+" you can do:

 (mods & ~consumed_modifiers) == (specified_modifiers & ~consumed_modifiers)

While with unconsumed_modifiers you would do the slightly less robust:

 unconsumed_modifiers == specified_modifiers

But it's also slightly more confusing. Any opinions on whether we should go with
the docs or the implementation?

Regards,
                                                       Owen



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