Commit Graph

23 Commits

Author SHA1 Message Date
Christian Kaiser 6f1870cff3 Add Run Command 2025-09-18 21:25:13 -03:00
David Capello 5d5f3ec234 Convert AppShortcut in a ui::Shortcut subclass 2025-09-12 15:48:38 -03:00
David Capello 71e680e05a Refactor key context matching (fix #5390)
* Added AppShortcut::fitsBetterThan() to compare shortcuts and decide
  which one is better depending on the current key context and the ones
  where shortcuts are defined
* Added Key::fitsContext() to known if this key definition makes sense
  for a given current key context, e.g. Normal context can be used in
  SelectionTool context, and SelectionTool can be used in Transformation
* Added KeyboardShortcuts::findBestKeyFromMessage() to centralize the
  keyboard shortcuts matching moving some code from
  CustomizedGuiManager::processKey()
* Added more keyboard shortcuts tests (including some for #5390)
2025-09-12 15:41:08 -03:00
David Capello 85793a9e5f Add AppShortcut to include app::KeySource + ui::Shortcut
We need a list of shorcuts (AppShortcuts) similar to ui::Shortcuts but
including the key source to compare later where the shortcut was
defined and give more priority to the user-defined shortcuts. This
logic is not yet added, this patch is only a refactor.
2025-09-12 15:07:26 -03:00
David Capello 21ad78cdbb Move app::Key to its own key.cpp file 2025-09-02 15:22:47 -03:00
David Capello 2b522e222b Rename ui::Accelerator to ui::Shortcut
This was a pending refactor, where "user.aseprite-keys" files were
already using the "shortcut" attribute (instead of "accelerator").
This will include a refactor in the Weblate projects/all translations
to change [select_accelerator] section to [select_shortcut]. But that
must be coordinated after this commit is merged.
2025-06-09 17:20:16 -03:00
Gaspar Capello ff0dfb8331 Fix regression: empty Edit > Keyboard Shortcuts > Action Modifiers (fix #4893) 2025-01-06 16:30:32 -03:00
David Capello b2e4f78b69 clang-format all files 2024-12-16 10:10:34 -03:00
Gaspar Capello 04c45f4329 Fix duplicate items in keyboard shortcuts list (fix #4387)
Introduced Key::isListed() and Command::isListed() to customize when a
command should be displayed in the list of shortcuts.

Removed commands:
'Launch'
'OpenBrowser'
And removed unnecessary commands:
'Change Color Mode: Indexed'
'Contract Selection'
'Export Sprite Sheet'
'Flip Canvas Horizontally'
'Frame Properties'
'Load Palette'
'Open Sprite'
'Playback Speed 1x'
'Run Script'
'Save Palette'
'Select Used Colors'
'Set Palette Entry Size'
'Tileset Mode: Auto'
2024-09-16 10:14:12 -03:00
David Capello 9b76f95b15 Fix Left/Right keys to move through frames in FramesSelection context (fix #3821) 2023-04-25 10:38:49 -03:00
David Capello a9207524ff Minor refactor in code to handle keys
Added CustomizedGuiManager::processKey() member function.
2023-04-25 10:30:39 -03:00
David Capello 46626bb5ce Merge branch 'main' into beta 2022-04-13 23:01:12 -03:00
David Capello e4c2995326 Extensions now support defining keyboard shortcuts (#1403, #3239) 2022-04-13 22:46:48 -03:00
David Capello 70a42c4c77 Add WheelAction to change InkType (related to #3195)
Mockup contributed here: https://community.aseprite.org/t/2468/10
2022-03-10 16:08:56 -03:00
David Capello 4ce2d1a340 Add option to simulate mouse wheel using key shortcut+drag mouse (fix #3195)
Now we can change several values (zoom, brush size, etc.) pressing a
keyboard shortcuts and dragging the mouse in a specific vector
direction (DragVector). It allows the modification of one, two, or
even more parameters at the same time (e.g. X axis to change the brush
size, Y axis the alpha value of the ink).
2022-03-08 20:40:11 -03:00
Gaspar Capello 4e12f4dcc2 Fix Alt+mouse wheel to scroll through tiles when we are in tiles mode (fix #2956)
Before this fix, Alt+mouse wheel to scroll through tiles didn't work as it did in the color palette.
Also, fixed tile deselection when user removes the focus of the tileset (for example, doing click in the editor).
2021-09-23 09:04:37 -03:00
David Capello 3fbdd40f24 Add skew transformation (fix #71)
This is the first version of the feature, it still needs some
fixes (e.g. avoid skew transform when the pivot is in the same side of
the skew handle which can calculate a division by zero).
2020-09-18 19:29:43 -03:00
David Capello 98d06c31e3 Refactor KeyContext <-> string conversions 2020-09-02 18:09:19 -03:00
David Capello 3a77321597 Add "intersect" selection mode
Discussions:
https://community.aseprite.org/t/intersectional-selection/801
https://community.aseprite.org/t/feature-request-intersect-with-selection-tool/1797
2018-10-26 14:04:08 -03:00
David Capello 95c6af355c Fix problems assigning different but similar modifiers to mouse wheel actions
For example, before this change we were depending on the order of the
wheel actions. If an action were associated to <Ctrl> and other one to
<Ctrl+Shift>, when we pressed <Ctrl+Shift> we weren't returning the
action with most modifiers pressed (in this case <Ctrl+Shift>), but
instead the one that was checked first in the for loop (which could
be the one with <Ctrl>).
2018-07-24 13:45:12 -03:00
David Capello 413603a71a Don't use KeyboardShortcuts singleton for temporal changes in Keyboard Shortcuts dialog
Main changes:

- Improve the "Keyboard Shortcuts" dialog because instead of changing
  global shortcuts/menu keys and rollback everything if we select
  "Cancel", here we make a copy of all shortcuts, modify them in the
  dialog UI, and finally "commit" to the global shortcuts if the user
  confirms the dialog.
- Fix "Reset" button in "Keyboard Shortcuts" dialog for mouse wheel
  customization
2018-07-23 15:15:04 -03:00
David Capello 7740f6a710 Add mouse wheel customization for sprite editor
Fix #680, #970, https://community.aseprite.org/t/668
and possibility to change alpha with mouse wheel:
https://github.com/aseprite/aseprite/issues/680#issuecomment-344721509
2018-07-19 23:05:14 -03:00
David Capello f33091dbfa Add KeyPtr as std::shared_ptr<Key> 2018-07-17 23:53:08 -03:00