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

Add options to disable event binding and focus. #62

Merged
merged 2 commits into from
Apr 23, 2015

Conversation

sufianrhazi
Copy link
Contributor

  • options.noEvents -- disable global events (keys, etc)
  • options.noFocus -- disable focus from click
  • options.noMouse -- disable mouse events

I used these additional options to allow for a ttyrec viewer, which (for usability) requires an inert terminal: http://sufianrhazi.github.io/viewtty.js/

- options.noEvents -- disable global events (keys, etc)
- options.noFocus -- disable focus from click
- options.noMouse -- disable mouse events
// Initialize global actions that
// need to be taken on the document.
this.initGlobal();
if (this.options.noEvents) {

Choose a reason for hiding this comment

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

Shouldn't this be negative - if (!this.options.noEvents)?

Also, maybe the options should be positively named, so you specify something like events=false instead of noEvents=true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this must've slipped by -- and good point regarding the positive naming, Il'l make these changes.

- options.useEvents -- if false, disable global events (keys, etc)
- options.useFocus -- if false, disable focus from click
- options.useMouse -- if false, disable mouse events
@sufianrhazi
Copy link
Contributor Author

Updated per @takluyver's comments.

chjj added a commit that referenced this pull request Apr 23, 2015
Add options to disable event binding and focus.
@chjj chjj merged commit 0d44161 into chjj:master Apr 23, 2015
@chjj
Copy link
Owner

chjj commented Apr 23, 2015

Thanks. I'll revise style a bit, but this is probably a good idea.

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.

None yet

3 participants