Add support to use mouse buttons (including X1 & X2) as shortcuts (fix #598)#4927
Conversation
aseprite-bot
left a comment
There was a problem hiding this comment.
clang-tidy made some suggestions
| const KeyboardShortcuts& globalKeys, | ||
| const KeyContext keyContext) const | ||
| const ui::Shortcut* Key::isPressed(const Message* msg, | ||
| const KeyboardShortcuts& globalKeys, |
There was a problem hiding this comment.
warning: parameter 'globalKeys' is unused [misc-unused-parameters]
| const KeyboardShortcuts& globalKeys, | |
| const KeyboardShortcuts& /*globalKeys*/, |
aseprite-bot
left a comment
There was a problem hiding this comment.
clang-tidy made some suggestions
aseprite-bot
left a comment
There was a problem hiding this comment.
clang-tidy made some suggestions
| { | ||
| bool state = (checkbox->isSelected()); | ||
| KeyModifiers modifiers = m_shortcut.modifiers(); | ||
| KeyScancode scancode = m_shortcut.scancode(); |
There was a problem hiding this comment.
warning: variable 'scancode' of type 'KeyScancode' (aka 'os::KeyScancode') can be declared 'const' [misc-const-correctness]
| KeyScancode scancode = m_shortcut.scancode(); | |
| KeyScancode const scancode = m_shortcut.scancode(); |
| alt()->setSelected(m_shortcut.modifiers() & kKeyAltModifier ? true : false); | ||
| ctrl()->setSelected(m_shortcut.modifiers() & kKeyCtrlModifier ? true : false); | ||
| shift()->setSelected(m_shortcut.modifiers() & kKeyShiftModifier ? true : false); | ||
| space()->setSelected(m_shortcut.modifiers() & kKeySpaceModifier ? true : false); |
There was a problem hiding this comment.
warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
space()->setSelected(m_shortcut.modifiers() & kKeySpaceModifier ? true : false);
^this fix will not be applied because it overlaps with another fix
| alt()->setSelected(m_shortcut.modifiers() & kKeyAltModifier ? true : false); | ||
| ctrl()->setSelected(m_shortcut.modifiers() & kKeyCtrlModifier ? true : false); | ||
| shift()->setSelected(m_shortcut.modifiers() & kKeyShiftModifier ? true : false); | ||
| space()->setSelected(m_shortcut.modifiers() & kKeySpaceModifier ? true : false); |
There was a problem hiding this comment.
warning: redundant boolean literal in ternary expression result [readability-simplify-boolean-expr]
| space()->setSelected(m_shortcut.modifiers() & kKeySpaceModifier ? true : false); | |
| space()->setSelected((m_shortcut.modifiers() & kKeySpaceModifier) != 0); |
| "Also known as Windows key, logo key,\ncommand key, or system key.", | ||
| TOP); | ||
| #endif | ||
| win()->setSelected(m_shortcut.modifiers() & kKeyWinModifier ? true : false); |
There was a problem hiding this comment.
warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
win()->setSelected(m_shortcut.modifiers() & kKeyWinModifier ? true : false);
^this fix will not be applied because it overlaps with another fix
| "Also known as Windows key, logo key,\ncommand key, or system key.", | ||
| TOP); | ||
| #endif | ||
| win()->setSelected(m_shortcut.modifiers() & kKeyWinModifier ? true : false); |
There was a problem hiding this comment.
warning: redundant boolean literal in ternary expression result [readability-simplify-boolean-expr]
| win()->setSelected(m_shortcut.modifiers() & kKeyWinModifier ? true : false); | |
| win()->setSelected((m_shortcut.modifiers() & kKeyWinModifier) != 0); |
d4c2bbb to
b1da5f8
Compare
0996744 to
e96ad18
Compare
aseprite-bot
left a comment
There was a problem hiding this comment.
clang-tidy made some suggestions
Without this patch assigning the same mouse button shortcut to a command would delete its assignment at all.
aseprite-bot
left a comment
There was a problem hiding this comment.
clang-tidy made some suggestions
| } | ||
| } | ||
|
|
||
| bool StandbyState::handleDragActionsFromMessage(Editor* editor, const ui::Message* msg) |
There was a problem hiding this comment.
warning: method 'handleDragActionsFromMessage' can be made static [readability-convert-member-functions-to-static]
src/app/ui/editor/standby_state.h:58:
- bool handleDragActionsFromMessage(Editor* editor, const ui::Message* msg);
+ static bool handleDragActionsFromMessage(Editor* editor, const ui::Message* msg);| } | ||
|
|
||
| Keys KeyboardShortcuts::getDragActionsFromKeyMessage(const ui::Message* msg) | ||
| Keys KeyboardShortcuts::getDragActionsFromMessage(const ui::Message* msg) |
There was a problem hiding this comment.
warning: method 'getDragActionsFromMessage' can be made static [readability-convert-member-functions-to-static]
src/app/ui/keyboard_shortcuts.h:78:
- Keys getDragActionsFromMessage(const ui::Message* msg);
+ static Keys getDragActionsFromMessage(const ui::Message* msg);
This is a work-in-progress to fix #598