Currently, there is no differentiation between left and right modifiers, though the comments have already constants defined for doing so. I would be interested in having the ability to distinguish between left and right, and I think a feature flag might be a practical approach to keep compatibility with existing code.
I would give it a try, but I am new to iced, so if anyone could give me some feedback on the plan:
Change the constants to the names suggested in the comments. Change the existing shift, etc methods to be something like:
#[cfg(feature = "double_sided_modifiers")]
pub fn shift(self) -> bool {
self.contains(Self::LSHIFT | Self::RSHIFT)
}
#[cfg(not(feature = "double_sided_modifiers"))]
pub fn shift(self) -> bool {
self.contains(Self::SHIFT)
}
Note the feature flag name is a working name, I am open to take suggestions. I think it is too long to actually be used, but I am terrible at finding names.
Also, with the feature flag added methods for left_shift, right_shift, left_ctrl, etc will be added.
However, the above approach will likely also work without the feature flag. Just modifying the public methods and adding left_shift, etc… will not need a feature flag. Yet, I do not see the implications right now, so the feature flag might be a fallback to use.
Any comments or suggestions are welcome. I’d do the modification if agreed on.
Thanks Johannes