drwhut / tabletop-club

An open-source platform for playing tabletop games in a physics-based 3D environment for Windows, macOS, and Linux! Made with the Godot Engine.
https://tabletopclub.net
MIT License
1.27k stars 55 forks source link

Switch default scroll wheel action when hovering, add keybindings. #155

Closed GrimPixel closed 1 year ago

GrimPixel commented 1 year ago

When I play the chess, I have to click the left mouse button, press the Ctrl key, then scroll the mouse wheel. This is the biggest inconsideration by far. I think I could simply press Ctrl or Shift to lift and drop pieces. Many other operations also require two keys pressed together.

elmodor commented 1 year ago

I would be able implement keybindings to raise/lower pieces if that's okay with @drwhut .

Which keys should be used to raise/lower the pieces? This is a keybinding that should only work when hovering a piece. Since Ctrl and Shift are already bound to other actions we would 2 other keys for this.

GrimPixel commented 1 year ago

I see. Q, E, Z, X, C are unassigned (on QWERTY layout).

drwhut commented 1 year ago

I had an idea after #140 was implemented - with your specific example, what if the current Ctrl+Scroll Wheel functionality was the default (as in, just Scroll Wheel would lift the piece perpendicular to the table, rather than towards/away from the camera)? Since pieces no longer change horizontal position when they are initially hovered, maybe this change could be made consistent to how one lifts a piece?

elmodor commented 1 year ago

Actually I had the same idea. So we swap the ctrl+scrollwheel and scrollwheel functionality for hovered pieces? Do we still want to add keybindings to raise the piece? Maybe it's more convenient to press some keys instead to use the scrollwheel?

drwhut commented 1 year ago

That would make sense - this is somewhat subjective though, so I'll ask some of the alpha testers what they think. Feel free to comment (anyone!) as well what you think would be the most intuitive way of going about this.

GrimPixel commented 1 year ago

An object in 3D space has 6 degrees of freedom. The mouse movements control x and y, the mouse wheel controls the z.

drwhut commented 1 year ago

For the next beta test, I'm going to try switching the default scroll wheel action to lifting pieces (perpendicular to the table), and having Ctrl+Scroll Wheel be zooming the piece in and out of the camera. I'll also think about key bindings to do this, as well.

elmodor commented 1 year ago

Sounds good! Would be cool if the scrollwheel would be a changeable keybind - if that is possible in godot.

drwhut commented 1 year ago

AFAIK the only way to get scroll wheel input is via _input() or _unprocessed_input() - but I'll have another look at the docs to see if there is a way, since that would simplify things.