- enum xkb_action_flags t1;
- xkb_mod_mask_t t2;
-
- if (array_ndx && field == ACTION_FIELD_MODIFIERS)
- return ReportActionNotArray(keymap, action->type, field);
-
- switch (field) {
- case ACTION_FIELD_MODIFIERS:
- t1 = act->flags;
- if (CheckModifierField(keymap, action->type, value, &t1, &t2)) {
- act->flags = t1;
- act->mods.mods = t2;
- return true;
- }
- return false;
-
- default:
- break;
- }
-
- return ReportIllegal(keymap, action->type, field);
+ const enum xkb_action_type type = action->type;
+
+ if (field == ACTION_FIELD_MODIFIERS)
+ return CheckModifierField(ctx, mods, action->type, array_ndx, value,
+ &act->flags, &act->mods.mods);
+ if ((type == ACTION_TYPE_MOD_SET || type == ACTION_TYPE_MOD_LATCH) &&
+ field == ACTION_FIELD_CLEAR_LOCKS)
+ return CheckBooleanFlag(ctx, action->type, field,
+ ACTION_LOCK_CLEAR, array_ndx, value,
+ &act->flags);
+ if (type == ACTION_TYPE_MOD_LATCH &&
+ field == ACTION_FIELD_LATCH_TO_LOCK)
+ return CheckBooleanFlag(ctx, action->type, field,
+ ACTION_LATCH_TO_LOCK, array_ndx, value,
+ &act->flags);
+ if (type == ACTION_TYPE_MOD_LOCK &&
+ field == ACTION_FIELD_AFFECT)
+ return CheckAffectField(ctx, action->type, array_ndx, value,
+ &act->flags);
+
+ return ReportIllegal(ctx, action->type, field);