Skip to content

Commit

Permalink
Expose "keycodes_per_modifier" property getter
Browse files Browse the repository at this point in the history
The GetModifierMapping request returns a list of keycodes. Client code
needs to iterate this list in chunks of keycodes_per_modifier to visit
all keycodes for each of the 8 modifiers (Shift, Lock, Control, Mod1,
Mod2, Mod3, Mod4, Mod5).

The preexisting whitelist of properties/fields that should not be
hidden has been extended to include this field.

Fixes #271
  • Loading branch information
andy-zetier committed Sep 10, 2024
1 parent f88b1a0 commit ffe4adf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build/cg/struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1683,8 +1683,13 @@ impl CodeGen {
// not simply the length of a slice, and they must be exposed so that the
// user can treat the slice as an image. The format field is important for
// GetPropertyReply where the value getter would panic if formats mismatch.
// The keycodes_per_modifier field is needed for iterating the list of
// keycodes returned in GetModifierMappingReply.
let visibility = if *is_fieldref
&& !(name == "width" || name == "height" || name == "format")
&& !(name == "width"
|| name == "height"
|| name == "format"
|| name == "keycodes_per_modifier")
{
""
} else {
Expand Down

0 comments on commit ffe4adf

Please sign in to comment.