-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat: add inputKey option to PanInput and WheelInput #204
Merged
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7c6d63a
feat: add inputKey option to PanInput and WheelInput
malangfox f49e489
fix: set passive of WheelInput to true
malangfox 266828a
chore: set WheelInput event listener passive to false
malangfox ffd17cd
test: add test case for no inputButton
malangfox 753ac81
docs: add inputKey demo
malangfox 974465c
feat: separate any and none in the condition of inputKey
malangfox 62fcc08
docs: add documentation for trackpad
malangfox 294b668
chore: update package.json
malangfox 85a6ae6
chore: apply lint
malangfox 9716ebb
docs: update inputKey option
malangfox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -313,7 +313,7 @@ Whether the event propagates to other instances when the coordinates reach the e | |
nested: true | ||
``` | ||
</div> | ||
<AxesBoard options={{ nested: true }} setNested={true}/> | ||
<AxesBoard options={{ nested: true }} demoType={"nested"}/> | ||
</div> | ||
</div> | ||
|
||
|
@@ -369,6 +369,34 @@ Types of input devices. | |
</div> | ||
</div> | ||
|
||
### inputKey | ||
Allow input only when one of these keys is pressed. If the array is empty, it accepts all keys with case of no key is pressed. | ||
- shift: shift key | ||
- ctrl: ctrl key | ||
- alt: alt key | ||
- meta: meta key | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should change the document, as it looks like |
||
|
||
<div className="columns"> | ||
<div className="column is-6"> | ||
<div> | ||
|
||
```js | ||
inputKey: [] | ||
``` | ||
</div> | ||
<AxesBoard panInputOptions={{ inputKey: [] }}/> | ||
</div> | ||
<div className="column is-6"> | ||
<div> | ||
|
||
```js | ||
inputKey: ["ctrl"] | ||
``` | ||
</div> | ||
<AxesBoard panInputOptions={{ inputKey: ["ctrl"] }}/> | ||
</div> | ||
</div> | ||
|
||
### inputButton | ||
List of buttons to allow input. | ||
- left: Left mouse button and normal touch | ||
|
@@ -440,10 +468,34 @@ Minimal pan distance required before recognizing. | |
<div> | ||
|
||
```js | ||
threshold: 5 | ||
threshold: 30 | ||
``` | ||
</div> | ||
<AxesBoard panInputOptions={{ threshold: 30 }}/> | ||
</div> | ||
</div> | ||
|
||
### preventClickOnDrag | ||
Whether to cancel the click event when the user finishes dragging more than 1 pixel. | ||
|
||
<div className="columns"> | ||
<div className="column is-6"> | ||
<div> | ||
|
||
```js | ||
preventClickOnDrag: false | ||
``` | ||
</div> | ||
<AxesBoard panInputOptions={{ preventClickOnDrag: false }} demoType={"preventClickOnDrag"}/> | ||
</div> | ||
<div className="column is-6"> | ||
<div> | ||
|
||
```js | ||
preventClickOnDrag: true | ||
``` | ||
</div> | ||
<AxesBoard panInputOptions={{ threshold: 5 }}/> | ||
<AxesBoard panInputOptions={{ preventClickOnDrag: true }} demoType={"preventClickOnDrag"}/> | ||
</div> | ||
</div> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mixing tab & space here