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 keyboard shortcuts #107

Merged
merged 4 commits into from
Jun 12, 2018
Merged

Add keyboard shortcuts #107

merged 4 commits into from
Jun 12, 2018

Conversation

ydlamba
Copy link
Member

@ydlamba ydlamba commented Jun 6, 2018

Add keyboard shortcuts

  • (Ctrl || CMD) && (B || S) for parsing.

Fixes #100.

@ydlamba
Copy link
Member Author

ydlamba commented Jun 6, 2018

@domoritz Can you share few more useful keyboard shortcuts for the editor?

this.editorWillMount = this.editorWillMount.bind(this);
}
public handleKeydown(e) {
if (e.keyCode === KEYCODES.B && e.ctrlKey && !this.props.autoParse) {
Copy link
Member

Choose a reason for hiding this comment

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

On mac os, it's CMD+B. We should be agnostic to that. How do we do this best?

@domoritz
Copy link
Member

domoritz commented Jun 6, 2018

@domoritz Can you share few more useful keyboard shortcuts for the editor?

I think build is the most important one. We could override CMD+S to build as well.

@ydlamba
Copy link
Member Author

ydlamba commented Jun 12, 2018

Visual feedback added.


.button:active,
.button-press {
box-shadow: 0 0 1px 0 #000;
Copy link
Member

Choose a reason for hiding this comment

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

box-shadow: 0 0 5px 1px steelblue;

}

.button:active,
.button-press {
Copy link
Member

Choose a reason for hiding this comment

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

just use pressed as the class

<button
id="parse-button"
className={this.props.parse ? 'button button-press' : 'button'}
onClick={() => this.props.parseSpec(true)}
Copy link
Member

Choose a reason for hiding this comment

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

can you make it so the button doesn't change when you click on it manually?

@domoritz domoritz merged commit b88ccd7 into master Jun 12, 2018
@domoritz domoritz deleted the ydl/shortcuts branch June 12, 2018 17:09
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.

2 participants