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

API: Mode change events #564

Open
p-e-w opened this issue May 28, 2017 · 0 comments
Open

API: Mode change events #564

p-e-w opened this issue May 28, 2017 · 0 comments

Comments

@p-e-w
Copy link
Contributor

p-e-w commented May 28, 2017

Proposed addition:

vis.events.subscribe(vis.events.MODE_CHANGE_PRE, function(new_mode)
  return new_mode
end)

vis.events.subscribe(vis.events.MODE_CHANGE_POST, function(old_mode)
end)

The return value of the MODE_CHANGE_PRE event handler is the mode that will actually be set. Thus to proceed with the requested change, return new_mode, and to cancel the mode switch return vis.mode.

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

No branches or pull requests

1 participant