Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/input/wintab/kis_tablet_support_win.cpp
Show First 20 Lines • Show All 291 Lines • ▼ Show 20 Line(s) | 283 | if (btn & btnNew) { | |||
---|---|---|---|---|---|
292 | * to be eaten by the driver, for example by its | 292 | * to be eaten by the driver, for example by its | ||
293 | * "Pan/Scroll" feature. Therefore we shouldn't handle | 293 | * "Pan/Scroll" feature. Therefore we shouldn't handle | ||
294 | * any of the events associated to it. So just return | 294 | * any of the events associated to it. So just return | ||
295 | * Qt::NoButton here. | 295 | * Qt::NoButton here. | ||
296 | */ | 296 | */ | ||
297 | if (convertedButton == Qt::NoButton) { | 297 | if (convertedButton == Qt::NoButton) { | ||
298 | 298 | | |||
299 | /** | 299 | /** | ||
300 | * Sometimes the driver-handled sortcuts are just | 300 | * Sometimes the driver-handled shortcuts are just | ||
301 | * keyboard modifiers, so ideally we should handle | 301 | * keyboard modifiers, so ideally we should handle | ||
302 | * them as well. The problem is that we cannot | 302 | * them as well. The problem is that we cannot | ||
303 | * know if the shortcut was a pan/zoom action or a | 303 | * know if the shortcut was a pan/zoom action or a | ||
304 | * shortcut. So here we use a "hackish" approash. | 304 | * shortcut. So here we use a "hackish" approach. | ||
305 | * We just check if any modifier has been pressed | 305 | * We just check if any modifier has been pressed | ||
306 | * and, if so, pass the button to Krita. Of | 306 | * and, if so, pass the button to Krita. Of | ||
307 | * course, if the driver uses some really complex | 307 | * course, if the driver uses some really complex | ||
308 | * shortcuts like "Shift + stylus btn" to generate | 308 | * shortcuts like "Shift + stylus btn" to generate | ||
309 | * some recorded shortcut, it will not work. But I | 309 | * some recorded shortcut, it will not work. But I | ||
310 | * guess it will be ok for th emost of the | 310 | * guess it will be ok for the most of the | ||
311 | * usecases. | 311 | * usecases. | ||
312 | * | 312 | * | ||
313 | * WARNING: this hack will *not* work if you bind | 313 | * WARNING: this hack will *not* work if you bind | ||
314 | * any non-modifier key to the stylus | 314 | * any non-modifier key to the stylus | ||
315 | * button, e.g. Space. | 315 | * button, e.g. Space. | ||
316 | */ | 316 | */ | ||
317 | 317 | | |||
318 | const Qt::KeyboardModifiers keyboardModifiers = QApplication::queryKeyboardModifiers(); | 318 | const Qt::KeyboardModifiers keyboardModifiers = QApplication::queryKeyboardModifiers(); | ||
▲ Show 20 Lines • Show All 614 Lines • ▼ Show 20 Line(s) | 908 | { | |||
933 | } | 933 | } | ||
934 | m_devices[m_currentDevice].currentPointerType = pointerType(pkCursor); | 934 | m_devices[m_currentDevice].currentPointerType = pointerType(pkCursor); | ||
935 | currentPkCursor = pkCursor; | 935 | currentPkCursor = pkCursor; | ||
936 | 936 | | |||
937 | // Check tablet name to enable Surface Pro 3 workaround. | 937 | // Check tablet name to enable Surface Pro 3 workaround. | ||
938 | #ifdef UNICODE | 938 | #ifdef UNICODE | ||
939 | if (!isSurfacePro3) { | 939 | if (!isSurfacePro3) { | ||
940 | /** | 940 | /** | ||
941 | * Some really "nice" tablet drivers don't know that trhey are | 941 | * Some really "nice" tablet drivers don't know that they are | ||
942 | * supposed to return their name length when the buffer is | 942 | * supposed to return their name length when the buffer is | ||
943 | * null and they try to write into it effectively causing a | 943 | * null and they try to write into it effectively causing a | ||
944 | * suicide. So we cannot rely on it :( | 944 | * suicide. So we cannot rely on it :( | ||
945 | * | 945 | * | ||
946 | * We workaround it by just allocating a big array and hoping | 946 | * We workaround it by just allocating a big array and hoping | ||
947 | * for the best. | 947 | * for the best. | ||
948 | * | 948 | * | ||
949 | * Failing tablets: | 949 | * Failing tablets: | ||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |