3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-12 18:12:37 +02:00

input-plugins/KeyboardMouseDevice: Cast Qt::Key to uint16_t for bitwise operation.

Fixes warning:
bitwise operation between different enumeration types ‘Qt::Key’ and ‘KeyboardMouseDevice::KeyboardChannel’ is deprecated.
This commit is contained in:
Lubosz Sarnecki 2024-08-03 18:44:21 +02:00
parent 4ce72674e9
commit d69f90635f

View file

@ -279,7 +279,7 @@ void KeyboardMouseDevice::touchUpdateEvent(const QTouchEvent* event) {
}
controller::Input KeyboardMouseDevice::InputDevice::makeInput(Qt::Key code) const {
auto shortCode = (uint16_t)(code & KEYBOARD_MASK);
uint16_t shortCode = static_cast<uint16_t>(code) & KEYBOARD_MASK;
if (shortCode != code) {
shortCode |= 0x0800; // add this bit instead of the way Qt::Key add a bit on the 3rd byte for some keys
}