Thomas Huth <thuth@xxxxxxxxxx> writes: > On 12/05/2022 14.16, Markus Armbruster wrote: [...] >>> This introduces the new "DisplaySDL" QAPI struct that is used to hold >>> the parameters that are unique to the SDL display. The only specific >>> parameter is currently "grab-mod" which is modeled as a string, so that >>> it could be extended for other arbitrary modifiers later more easily. >> >> Are the values of @grab-mod parsed in any way, or do we recognize a set >> of fixed strings? >> >> The former would be problematic. We try hard to represent complex data >> as JSON instead of inventing little ad hoc languages. >> >> If it's the latter, use an enum. Makes introspection more useful, and >> adding enumeration values is no harder than adding string literals. > > It's currently only two strings that are used to replace the old behavior. > But in the long run, I think it would be nice to have more flexibility here, > so that a user could specify an arbitrary combination of modifier keys. I > don't think that an enum will really scale here, so I'd prefer to go with > the current approach and use the string for more flexibility. "Arbitrary combination of modifier keys" sounds like set of enum to me. We approximate sets with lists in QAPI.