Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/input/kis_input_manager_p.cpp
Context not available. | |||||
23 | #include <QScopedPointer> | 23 | #include <QScopedPointer> | ||
---|---|---|---|---|---|
24 | #include <QtGlobal> | 24 | #include <QtGlobal> | ||
25 | 25 | | |||
26 | #include <boost/preprocessor/repeat_from_to.hpp> | ||||
27 | | ||||
26 | #include "kis_input_manager.h" | 28 | #include "kis_input_manager.h" | ||
27 | #include "kis_config.h" | 29 | #include "kis_config.h" | ||
28 | #include "kis_abstract_input_action.h" | 30 | #include "kis_abstract_input_action.h" | ||
Context not available. | |||||
363 | return QObject::eventFilter(object, event); | 365 | return QObject::eventFilter(object, event); | ||
364 | } | 366 | } | ||
365 | 367 | | |||
368 | #define EXTRA_BUTTON(z, n, _) \ | ||||
369 | if(buttons & Qt::ExtraButton##n) { \ | ||||
370 | buttonList << Qt::ExtraButton##n; \ | ||||
371 | } | ||||
372 | | ||||
366 | void KisInputManager::Private::addStrokeShortcut(KisAbstractInputAction* action, int index, | 373 | void KisInputManager::Private::addStrokeShortcut(KisAbstractInputAction* action, int index, | ||
367 | const QList<Qt::Key> &modifiers, | 374 | const QList<Qt::Key> &modifiers, | ||
368 | Qt::MouseButtons buttons) | 375 | Qt::MouseButtons buttons) | ||
Context not available. | |||||
380 | if(buttons & Qt::MidButton) { | 387 | if(buttons & Qt::MidButton) { | ||
381 | buttonList << Qt::MidButton; | 388 | buttonList << Qt::MidButton; | ||
382 | } | 389 | } | ||
383 | if(buttons & Qt::XButton1) { | 390 | | ||
384 | buttonList << Qt::XButton1; | 391 | BOOST_PP_REPEAT_FROM_TO(1, 25, EXTRA_BUTTON, _) | ||
385 | } | | |||
386 | if(buttons & Qt::XButton2) { | | |||
387 | buttonList << Qt::XButton2; | | |||
388 | } | | |||
389 | 392 | | |||
390 | if (buttonList.size() > 0) { | 393 | if (buttonList.size() > 0) { | ||
391 | strokeShortcut->setButtons(QSet<Qt::Key>::fromList(modifiers), QSet<Qt::MouseButton>::fromList(buttonList)); | 394 | strokeShortcut->setButtons(QSet<Qt::Key>::fromList(modifiers), QSet<Qt::MouseButton>::fromList(buttonList)); | ||
Context not available. |