framework
framework copied to clipboard
Qt.ImhDigitsOnly is not handled correctly
In MInputContext::contentType(), the following lines of code treat Qt.ImhDigitsOnly and Qt::ImhFormattedNumbersOnly the same:
if (hints == Qt::ImhFormattedNumbersOnly || hints == Qt::ImhDigitsOnly) {
type = Maliit::NumberContentType;
} else ...
This can't be correct.
The docs have the following:
ImhDigitsOnly: Only digits are allowed. ImhFormattedNumbersOnly: Only number input is allowed. This includes decimal point and minus sign.
To correctly handle both flags, maliit needs a new contentType. Something like Maliit::DigitContentType maybe.
Found this as I was looking into why DigitsOnly doesn't work at all using Wayland input method protocol. It seems like fixing this the right way, probably also requires breaking ABI/API. There are also other input method hints not being handled at all by Maliit currently, which would be nice to fix.
#66 fixes this as long as you were finding the problem when using the input_method_v1 source, @mikix can you confirm?
#66 fixes this as long as you were finding the problem when using the input_method_v1 source, @mikix can you confirm?
No, the issue reported here is that DigitsOnly and FormatedNumberesOnly are being treated equally, while they should be different (DigitsOnly shouldn't have -, #, etc… symbols). #66 only fixes that DigitsOnly wasn't working at all with the wayland protocol. :)