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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Desktop] Navigate back with mouse back button #56919

Closed
nilsreichardt opened this issue May 11, 2020 · 6 comments
Closed

[Desktop] Navigate back with mouse back button #56919

nilsreichardt opened this issue May 11, 2020 · 6 comments

Comments

@nilsreichardt
Copy link
Contributor

Use case

At the moment it is not possible to navigate back (Navigator.pop()) with a mouse back button on macOS, Windows and Linux. Flutter web is able handle the mouse back button 馃憤

image

Proposal

If you press the mouse back button, Flutter should call Navigator.pop()

This question is: Should it also be possible to use the forward button?

@sampathbalivada
Copy link

Hey @AndroidNils, can you please specify any Native applications (Not built into the OS) which successfully implement the said behaviour? It would be nice to have a reference as Navigation on desktop applications is in most cases mapped to on-screen buttons of the application.

@nilsreichardt
Copy link
Contributor Author

@sampathbalivada Discord and Slack support mouse button navigation. You can undo and redo every navigation action (back and forward navigation).

@stuartmorgan
Copy link
Contributor

At the moment it is not possible to navigate back (Navigator.pop()) with a mouse back button on macOS, Windows and Linux.

Are you saying you're not able to detect those buttons with gesture handlers on any desktop platform? Sample code and what you're getting on macOS and Windows would be helpful. (For Linux, see #33220).

If you press the mouse back button, Flutter should call Navigator.pop()

Generally speaking (maybe there are exceptions) mice don't have "back" and "forward" buttons, they have additional buttons that are subject to application-specific interpretation. For instance, the Win32 API names for those buttons (unless there's a driver doing something specific) would be XBUTTON1 and XBUTTON2. Determining their meaning is something that should be done at the application level, not the framework level.

@nilsreichardt
Copy link
Contributor Author

nilsreichardt commented May 11, 2020

Determining their meaning is something that should be done at the application level, not the framework level.

@stuartmorgan Ok, thanks for your explanation! I'm going to close this issue 馃憤

@sampathbalivada
Copy link

Just in case it helps in building something somewhere, Discord and Slack are built using Electron. They're essentially headless Chrome instances running as Applications. That might be the reason for the functionality being available.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants