Skip to content

Overhaul mouse input system and look-around camera - #1278

Open
adfriz wants to merge 8 commits into
leezer3:masterfrom
adfriz:mouse-input
Open

Overhaul mouse input system and look-around camera#1278
adfriz wants to merge 8 commits into
leezer3:masterfrom
adfriz:mouse-input

Conversation

@adfriz

@adfriz adfriz commented Apr 26, 2026

Copy link
Copy Markdown
Contributor
  • Implement smooth mouse look-around using System.Windows.Forms.Cursor.
  • Fix camera spinning and choppiness by bypassing OpenTK event lag.
  • Add dynamic sensitivity scaling based on zoom level (FOV).
  • Add support for mouse scroll and extra buttons in input processing.
  • Update Indonesian and English translations for new mouse controls.
  • Add default control mappings for mouse input.

Note: there is a small bug, if we in look around mode (right click mouse) and look backward, anything not loaded like got culled and it need to be triggerd by something like moving the camera position a bit or use arrow key once.

@leezer3 i need your help about that bug.

@adfriz

adfriz commented Apr 26, 2026

Copy link
Copy Markdown
Contributor Author

preview, i set scroll up/down as zoom in/out and we can do interesting stuff like dolly zoom.

*i need to compress this video because github upload limit

Screen.Recording.2026-04-26.1114382.mp4

@leezer3

leezer3 commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Hmm.

The issue with using the System.Windows.Forms.Cursor approach is going to be on platforms other than Windows- Without checking specifically, it's unlikely to work at all on Mac, and Linux may or may not work.

To immediately fix your bug, set the alignment direction, not the alignment directly.
Alternatively, you can call the UpdateViewingDistances method from the renderer.
By setting the aligment directly, you're bypassing the viewing distances update, and so the camera still thinks it's got the same backwards viewing distance as when it's pointing forwards.

- Implement smooth mouse look-around using System.Windows.Forms.Cursor.
- Fix camera spinning and choppiness by bypassing OpenTK event lag.
- Add dynamic sensitivity scaling based on zoom level (FOV).
- Add support for mouse scroll and extra buttons in input processing.
- Update Indonesian and English translations for new mouse controls.
- Add default control mappings for mouse input.
… setting with max limit, and update localization.
@adfriz

adfriz commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

ok its done.

@leezer3 please check.

adfriz added 5 commits August 21, 2026 23:00
…options overlap

- Track held modifiers across KeyDown/KeyUp so mouse bindings can require them
- Load/save an optional trailing modifier column for mouse controls (backwards compatible)
- Show Shift/Ctrl/Alt checkboxes for mouse bindings in Options > Controls
- Fix updownZoomScrollSpeed overflowing its groupbox and groupboxCamera overlapping the Object Parser group
…apture

- Record the press order of Shift/Ctrl/Alt so e.g. Ctrl->Shift+A and Shift->Ctrl+A are distinct bindings
- Store an optional trailing modifier-order column in controls.cfg (0 = any order, backwards compatible)
- Track held modifier sequence at runtime and enforce it when matching keyboard and mouse bindings
- Options dialog: grab box now captures held modifiers instead of binding the modifier keys themselves
- Checkbox tick order defines the recorded press order; assignment column displays the stored order
@adfriz

adfriz commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

Nice all checks green. I think this feature is done...

@leezer3 can you have a look?

@ginga81 do you want to test this mouse input feature on linux?

How to:
Go to customize control page.
choose some controls you want to edit.
choose mouse input and set the button and modifier.

My test scenario is to change:
Zoom in : CTRL + SHIFT + Scroll Up
Zoom out: CTRL + SHIFT + Scroll down
Toggle mouse Grab mode: Right click

if can, please also test modifier swap combination, like:

Zoom in : CTRL + SHIFT + Scroll Up
Zoom out: SHIFT + CTRL + Scroll Up

I hope not broken on other platforms...

@ginga81

ginga81 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

I built and ran the application.
I was able to map scrolling to the mouse wheel, zoom in and out using Ctrl+Shift+Wheel, and switch viewpoints via right-click using a camera movement style that differs from the previous one.
Also can swap to the wheel settings.

Personally, I felt the wheel speed was very slow when zooming in and out.
Zooming in and out was faster using the keyboard.

@adfriz

adfriz commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

You can change it on options page, it's called zoom camera speed.

I think I'll change the default speed maybe 50.

@ginga81

ginga81 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

I just discovered this on the options page.
The default was 30, and I set it to the maximum of 100.
But, I actually wish I could set it to about 300 or faster...

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.

3 participants