Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canvas keybinding controls #177

Merged
merged 4 commits into from
Jul 9, 2022

Conversation

MrApplejuice
Copy link
Contributor

This is the one that I really was interested in (especially the zoom).

Maybe also addresses: #147 (?)

s.mp4
  • Adds keybinding actions for panning the canvas and zooming. Default keybindings: Arrow keys and +/- for zooming
  • Refactored the way cursors update their position, making the cursors themselves responsible for updating their location. Removed cursor position updates from all tools.
    • Had to be done, because panning was causing the cursor location to shift and adding the fix to that to all tools seemed like an extreme amount of code duplication.

Copy link
Owner

@mbrlabs mbrlabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Not sure why Godot thinks my Plus key (for zooming in) on my german keyboard is an Equal though. But i can remap it, so no big deal.

@mbrlabs mbrlabs merged commit b017256 into mbrlabs:main Jul 9, 2022
@mbrlabs
Copy link
Owner

mbrlabs commented Jul 9, 2022

Btw, while your'e at at...the list of keybindings becomes pretty big. Can we maybe sort them alphabetically by name? This way all the "Pan" actions would be grouped together for example and stuff is easier to find in general.

Edit: Ah i just see you use an unordered map/dictionary for this. The order is different everytime Lorien is started. Probably a good idea to convert to an array sort it and then build the UI list from that.

Edit: Nevermind it's already an Array built from the InputMap. So it would only need to be sorted.

@MrApplejuice
Copy link
Contributor Author

Looks good! Not sure why Godot thinks my Plus key (for zooming in) on my German keyboard is an Equal though. But i can remap it, so no big deal.

That is weird... I am using a German keyboard, too, and tested both: Numpad Plus and "normal" Plus keys and both are recognized correctly. I assume that there is a OS difference (I am on Linux, you on Mac?). I was worried about that. Godot is attempting to distinguish between "physical keys" and "regaular keys". I think the first ones are meant to be keyboard agnostic. However, I am not sure which ones I am actually recognizing with the scancode and OS-functions I am using... they seem to be the "regular keys" but there might be still some sort of bug. I assume that the Godot editor is correctly recognizing the "Plus"-key?

@MrApplejuice MrApplejuice mentioned this pull request Jul 11, 2022
@mbrlabs
Copy link
Owner

mbrlabs commented Jul 11, 2022

I'm on Windows..but yeah might be an OS difference. I can test it on Linux tomorrow (it's a laptop with a differnt keyboard though).

I assume that the Godot editor is correctly recognizing the "Plus"-key?

Do you mean in the code editor for example? Yes, it works there. But in the InputMap dialog i get an Equal for the normal key and BraceRight (Physical) for the physical key. Really weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants