Skip to content

Commit ffe4adf

Browse files
committed
Expose "keycodes_per_modifier" property getter
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
1 parent f88b1a0 commit ffe4adf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

build/cg/struct.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1683,8 +1683,13 @@ impl CodeGen {
16831683
// not simply the length of a slice, and they must be exposed so that the
16841684
// user can treat the slice as an image. The format field is important for
16851685
// GetPropertyReply where the value getter would panic if formats mismatch.
1686+
// The keycodes_per_modifier field is needed for iterating the list of
1687+
// keycodes returned in GetModifierMappingReply.
16861688
let visibility = if *is_fieldref
1687-
&& !(name == "width" || name == "height" || name == "format")
1689+
&& !(name == "width"
1690+
|| name == "height"
1691+
|| name == "format"
1692+
|| name == "keycodes_per_modifier")
16881693
{
16891694
""
16901695
} else {

0 commit comments

Comments
 (0)